localstack / localstack Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove delete integration patch #6074
Conversation
40cfa5e
to
428f06e
Compare
0402ea2
to
4917a42
Compare
LGTM overall @calvernaz !
except Exception as e: | ||
raise NotFoundException("Invalid Resource identifier specified") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make sense to limit the exception clause a bit. You can inspect botocore exceptions by catching CommonServiceException
and then checking e.code
for the particular error code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example of that exception handle practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in most cases you can simply pass through the exception and don't need to do anything. if moto raises a NotFoundException
, then call_moto
will re-raise something that is equivalent and will be rendered correctly.
here's an example where we inspect the exception and re-raise them conditionally. not sure that's your use case though
localstack/localstack/services/dynamodb/provider.py
Lines 466 to 480 in 5ee3711
@handler("UpdateTable", expand=False) | |
def update_table( | |
self, context: RequestContext, update_table_input: UpdateTableInput | |
) -> UpdateTableOutput: | |
try: | |
# forward request to backend | |
result = self.forward_request(context) | |
except CommonServiceException as e: | |
is_no_update_error = ( | |
e.code == "ValidationException" and "Nothing to update" in e.message | |
) | |
if not is_no_update_error or not list( | |
{"TableClass", "ReplicaUpdates"} & set(update_table_input.keys()) | |
): | |
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it makes sense depending on the case, as we talked in private is not applicable in this case.
This PR removes the patch for the delete integration operation.