Capture error and return to the user