Edit error handler on sql