mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Adds a POST version of get inbound messages by phone number. Allows us to POST the search so the phone number is hidden
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from flask import (
|
||||
jsonify,
|
||||
current_app
|
||||
)
|
||||
current_app,
|
||||
json)
|
||||
from sqlalchemy.exc import SQLAlchemyError, DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
from marshmallow import ValidationError
|
||||
from jsonschema import ValidationError as JsonSchemaValidationError
|
||||
from app.authentication.auth import AuthError
|
||||
from app.notifications import SendNotificationToQueueError
|
||||
|
||||
@@ -50,6 +51,11 @@ def register_errors(blueprint):
|
||||
current_app.logger.error(error)
|
||||
return jsonify(result='error', message=error.messages), 400
|
||||
|
||||
@blueprint.errorhandler(JsonSchemaValidationError)
|
||||
def validation_error(error):
|
||||
current_app.logger.exception(error)
|
||||
return jsonify(json.loads(error.message)), 400
|
||||
|
||||
@blueprint.errorhandler(InvalidRequest)
|
||||
def invalid_data(error):
|
||||
response = jsonify(error.to_dict())
|
||||
|
||||
Reference in New Issue
Block a user