|
7 | 7 | from botocore.model import ServiceModel
|
8 | 8 |
|
9 | 9 | from localstack.aws.api import (
|
10 |
| - CommonServiceException, |
11 | 10 | RequestContext,
|
12 | 11 | ServiceException,
|
13 | 12 | )
|
|
16 | 15 | from localstack.aws.protocol.serializer import ResponseSerializer, create_serializer
|
17 | 16 | from localstack.aws.spec import load_service
|
18 | 17 | from localstack.http import Response
|
19 |
| -from localstack.utils import analytics |
20 |
| -from localstack.utils.coverage_docs import get_coverage_link_for_service |
21 | 18 |
|
22 | 19 | LOG = logging.getLogger(__name__)
|
23 | 20 |
|
@@ -153,8 +150,6 @@ def invoke(self, context: RequestContext) -> Response:
|
153 | 150 | return self.dispatch_request(serializer, context, instance)
|
154 | 151 | except ServiceException as e:
|
155 | 152 | return self.on_service_exception(serializer, context, e)
|
156 |
| - except NotImplementedError as e: |
157 |
| - return self.on_not_implemented_error(serializer, context, e) |
158 | 153 |
|
159 | 154 | def dispatch_request(
|
160 | 155 | self, serializer: ResponseSerializer, context: RequestContext, instance: ServiceRequest
|
@@ -193,35 +188,3 @@ def on_service_exception(
|
193 | 188 | return serializer.serialize_error_to_response(
|
194 | 189 | exception, context.operation, context.request.headers, context.request_id
|
195 | 190 | )
|
196 |
| - |
197 |
| - def on_not_implemented_error( |
198 |
| - self, |
199 |
| - serializer: ResponseSerializer, |
200 |
| - context: RequestContext, |
201 |
| - exception: NotImplementedError, |
202 |
| - ) -> Response: |
203 |
| - """ |
204 |
| - Called by invoke if either the dispatch table did not contain an entry for the operation, or the service |
205 |
| - provider raised a NotImplementedError |
206 |
| - :param serializer: the serialzier which should be used to serialize the NotImplementedError |
207 |
| - :param context: the request context |
208 |
| - :param exception: the NotImplementedError that was raised |
209 |
| - :return: a Response object |
210 |
| - """ |
211 |
| - operation = context.operation |
212 |
| - |
213 |
| - action_name = operation.name |
214 |
| - service_name = operation.service_model.service_name |
215 |
| - exception_message: str | None = exception.args[0] if exception.args else None |
216 |
| - message = exception_message or get_coverage_link_for_service(service_name, action_name) |
217 |
| - LOG.info(message) |
218 |
| - error = CommonServiceException("InternalFailure", message, status_code=501) |
219 |
| - # record event |
220 |
| - analytics.log.event( |
221 |
| - "services_notimplemented", payload={"s": service_name, "a": action_name} |
222 |
| - ) |
223 |
| - context.service_exception = error |
224 |
| - |
225 |
| - return serializer.serialize_error_to_response( |
226 |
| - error, operation, context.request.headers, context.request_id |
227 |
| - ) |
0 commit comments