Adding optional callback in event of failure

Previously in the event of a transpilation error, the log would indicate an
error occurred and the process would hang indefinitely.

This adds the possibility of callback execution in the event of a
transpilation error, to do things like cleanup the process or whatever
else the user might want to do.