+ private SomeModifiersUnresolvedException propagateException(final SourceSpecificContext source,
+ final RuntimeException cause) throws SomeModifiersUnresolvedException {
+ final SourceIdentifier sourceId = Utils.createSourceIdentifier(source.getRoot());
+ if (!(cause instanceof SourceException)) {
+ /*
+ * This should not be happening as all our processing should provide SourceExceptions.
+ * We will wrap the exception to provide enough information to identify the problematic model,
+ * but also emit a warning so the offending codepath will get fixed.
+ */
+ LOG.warn("Unexpected error processing source {}. Please file an issue with this model attached.",
+ sourceId, cause);
+ }
+
+ throw new SomeModifiersUnresolvedException(currentPhase, sourceId, cause);
+ }
+