instead of trigger_error, throw a DBException