Skip to content

Commit

Permalink
improve error message (#109)
Browse files Browse the repository at this point in the history
useful because MelangeDerivedStateComputer tends to "randomly" fails
(ie. we don't know yet why ;-) ) and a "clean all" may help.
The message helps to track and debug the issue.
  • Loading branch information
dvojtise committed Apr 11, 2018
1 parent e6650a7 commit 71c2e60
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -102,16 +102,25 @@ class MelangeDerivedStateComputer extends JvmModelAssociator
try {
processors.forEach[p |
val pTask = Stopwatches.forTask(p.class.simpleName)
pTask.start
p.preProcess(root, preLinkingPhase)
pTask.stop
try {
pTask.start
p.preProcess(root, preLinkingPhase)
} catch (Exception e) {
log.error(" exception in "+p.class.simpleName+ " while processing " + resource.URI+ " (may be temporary, try a clean all) ", e)
} finally {
pTask.stop
}
]

// Setting context for non-inferrer helper classes
builder.setContext(resource.resourceSet)
helper.setContext(resource.resourceSet)

task.stop

} catch (Exception e) {
log.error(" exception while processing " + resource.URI+ " (may be temporary, try a clean all) ", e)
} finally {
// Avoid computing all the derived state when unnecessary,
// ie. if we don't have Xbase code in transformations that
// relies on the code generated by Melange, we don't need
Expand All @@ -120,8 +129,6 @@ class MelangeDerivedStateComputer extends JvmModelAssociator
super.installDerivedState(resource, preLinkingPhase)
else
super.installDerivedState(resource, true)
} catch (Exception e) {
log.error("Fatal exception", e)
}
}
}
Expand Down

0 comments on commit 71c2e60

Please sign in to comment.