Update errors

Added error handler function to output errors to the user