Better handling of exceptions thrown by engine