mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
Remove v2 error handler for InvalidPhoneError, no longer expect to throw this exception.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import json
|
||||
from flask import jsonify, current_app
|
||||
from jsonschema import ValidationError
|
||||
from notifications_utils.recipients import InvalidPhoneError
|
||||
from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
from app.authentication.auth import AuthError
|
||||
@@ -48,12 +47,6 @@ def register_errors(blueprint):
|
||||
def auth_error(error):
|
||||
return jsonify(error.to_dict_v2()), error.code
|
||||
|
||||
@blueprint.errorhandler(InvalidPhoneError)
|
||||
def invalid_phone_error(error):
|
||||
current_app.logger.exception(error)
|
||||
return jsonify(status_code=400,
|
||||
errors=[{"error": error.__class__.__name__, "message": error.message}]), 400
|
||||
|
||||
@blueprint.errorhandler(Exception)
|
||||
def internal_server_error(error):
|
||||
current_app.logger.exception(error)
|
||||
|
||||
Reference in New Issue
Block a user