fix: global error handler should propagate errors

Closes #368