Improved error handling - Errors are now emitted via a notice event