Refactor db_error_out (show output when not serving ajax callback)