def METHOD_NAME(func):
    """Jsonify errors."""
    @wraps(func)
    def decorated_view(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except HTTPException as httpe:
            return jsonify({'message': f'{httpe}'}), httpe.code
        except Exception as error:
            # raise error
            # current_app.logger.error(str(error))
            return jsonify({'message': f'{error}'}), 400
    return decorated_view