Skip to main content



      Home
Home » Modeling » EMF » Skipping resolution error when loading
Skipping resolution error when loading [message #1738565] Wed, 20 July 2016 17:31 Go to next message
Eclipse UserFriend
Hi,
When loading a file, from what I observed the loader stops at the first encountered error (e.g. IllegalValueException).
Is there a way to ignore errors like unresolved IDs?
I tried various XMLResource options, but none seemed to work.

Thanks!
Re: Skipping resolution error when loading [message #1738576 is a reply to message #1738565] Thu, 21 July 2016 01:09 Go to previous messageGo to next message
Eclipse UserFriend
Raphael,

It only seems as if loading stops at the first encountered error,
because an exception is thrown, but the resource loads as much of the
model as is possible, recording exceptions for any problem (in
Resource.getErrors()), and then at the end, it rethrows the first
recorded exception. That's why a generated editor uses this pattern to
get the resource the first time:

Exception exception = null;
Resource resource = null;
try
{
// Load the resource through the editing domain.
//
resource =
editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e)
{
exception = e;
resource =
editingDomain.getResourceSet().getResource(resourceURI, false);
}


On 20.07.2016 23:31, Raphael B wrote:
> Hi,
> When loading a file, from what I observed the loader stops at the
> first encountered error (e.g. IllegalValueException).
> Is there a way to ignore errors like unresolved IDs?
> I tried various XMLResource options, but none seemed to work.
>
> Thanks!
Re: Skipping resolution error when loading [message #1738622 is a reply to message #1738576] Thu, 21 July 2016 09:35 Go to previous message
Eclipse UserFriend
Oh I see, thanks Ed!
Previous Topic:Constraining Cardinality in EMF
Next Topic:CDO and Walking EMF
Goto Forum:
  


Current Time: Wed Jul 23 09:53:17 EDT 2025

Powered by FUDForum. Page generated in 0.28195 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top