Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Skipping resolution error when loading
Skipping resolution error when loading [message #1738565] Wed, 20 July 2016 21:31 Go to next message
Raphael B is currently offline Raphael BFriend
Messages: 14
Registered: April 2013
Junior Member
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 05:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
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!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Skipping resolution error when loading [message #1738622 is a reply to message #1738576] Thu, 21 July 2016 13:35 Go to previous message
Raphael B is currently offline Raphael BFriend
Messages: 14
Registered: April 2013
Junior Member
Oh I see, thanks Ed!
Previous Topic:Constraining Cardinality in EMF
Next Topic:CDO and Walking EMF
Goto Forum:
  


Current Time: Tue Jun 15 17:36:42 GMT 2021

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

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

Back to the top