Wrapped the error code in a try/catch, we don't want an error during the db-save to hide the real error