Updated Error Handling

Show user the error message received before trying to log the error.
Minor Changes to the architecture of the database