Skip to content

Commit

Permalink
Better error reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 9, 2016
1 parent 8be43b8 commit 553974f
Showing 1 changed file with 5 additions and 5 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2016 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -297,7 +297,7 @@ private EventResult readFromStreamAndValidate(XMLStreamReader stream, OperationR
handler.handleGlobalError(validatorResult);
}
objectResult.recordFatalError(ex);
return EventResult.skipObject();
return EventResult.skipObject(ex.getMessage());
}

objectResult.addContext(END_LINE_NUMBER, stream.getLocation().getLineNumber());
Expand Down Expand Up @@ -365,7 +365,7 @@ private EventResult validateObjectInternal(Element objectElement, OperationResul
object.checkConsistence();
} catch (RuntimeException e) {
objectResult.recordFatalError("Internal object inconsistence, probably a parser bug: "+e.getMessage(), e);
return EventResult.skipObject();
return EventResult.skipObject(e.getMessage());
}

Objectable objectType = null;
Expand Down Expand Up @@ -416,7 +416,7 @@ private EventResult validateObjectInternal(Element objectElement, OperationResul
}
}
objectResult.recordFatalError(ex);
return EventResult.skipObject();
return EventResult.skipObject(ex.getMessage());
} catch (RuntimeException ex) {
validatorResult.recordFatalError("Couldn't parse object: " + ex.getMessage(), ex);
if (verbose) {
Expand All @@ -432,7 +432,7 @@ private EventResult validateObjectInternal(Element objectElement, OperationResul
}
}
objectResult.recordFatalError(ex);
return EventResult.skipObject();
return EventResult.skipObject(ex.getMessage());
}

}
Expand Down

0 comments on commit 553974f

Please sign in to comment.