|
Re: Skipping resolution error when loading [message #1738576 is a reply to message #1738565] |
Thu, 21 July 2016 05:09 |
Ed Merks Messages: 33113 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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.28077 seconds