From 9e73d10e591bcf81805582246d59eb9f51ce865e Mon Sep 17 00:00:00 2001 From: dominictootell Date: Wed, 14 Sep 2016 11:52:56 +0100 Subject: [PATCH] Not, not Non for the exception. --- moto/apigateway/exceptions.py | 6 +++--- moto/apigateway/models.py | 4 ++-- moto/apigateway/responses.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/moto/apigateway/exceptions.py b/moto/apigateway/exceptions.py index ed007d61..77a1c932 100644 --- a/moto/apigateway/exceptions.py +++ b/moto/apigateway/exceptions.py @@ -2,11 +2,11 @@ from __future__ import unicode_literals from moto.core.exceptions import RESTError -class StageNonFoundException(RESTError): +class StageNotFoundException(RESTError): code = 404 def __init__(self): - super(StageNonFoundException, self).__init__( - "NonFoundException", "Invalid stage identifier specified") + super(StageNotFoundException, self).__init__( + "NotFoundException", "Invalid stage identifier specified") diff --git a/moto/apigateway/models.py b/moto/apigateway/models.py index 90e5b0bd..11d650e0 100644 --- a/moto/apigateway/models.py +++ b/moto/apigateway/models.py @@ -7,7 +7,7 @@ import requests from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime_with_milliseconds from .utils import create_id -from .exceptions import StageNonFoundException +from .exceptions import StageNotFoundException STAGE_URL = "https://{api_id}.execute-api.{region_name}.amazonaws.com/{stage_name}" @@ -427,7 +427,7 @@ class APIGatewayBackend(BaseBackend): api = self.get_rest_api(function_id) stage = api.stages.get(stage_name) if stage is None: - raise StageNonFoundException() + raise StageNotFoundException() else: return stage diff --git a/moto/apigateway/responses.py b/moto/apigateway/responses.py index e95d2887..e8c353f4 100644 --- a/moto/apigateway/responses.py +++ b/moto/apigateway/responses.py @@ -4,7 +4,7 @@ import json from moto.core.responses import BaseResponse from .models import apigateway_backends -from .exceptions import StageNonFoundException +from .exceptions import StageNotFoundException class APIGatewayResponse(BaseResponse): @@ -136,7 +136,7 @@ class APIGatewayResponse(BaseResponse): if self.method == 'GET': try: stage_response = self.backend.get_stage(function_id, stage_name) - except StageNonFoundException as error: + except StageNotFoundException as error: return error.code, headers,'{{"message":"{0}","code":"{1}"}}'.format(error.message,error.error_type) elif self.method == 'PATCH': patch_operations = self._get_param('patchOperations')