Added an error handler for dev mode