-
Notifications
You must be signed in to change notification settings - Fork 48
fixed create/delete handler pre execution check #266
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
Conversation
| // TODO: uncomment when ready to implement | ||
| // if (exception instanceof CfnNotFoundException) | ||
| // return ProgressEvent.progress(model, context); | ||
| // throw exception; |
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 tested throwing exceptions here, and they are not bubbled all the way up. The handler ends up returning a status code of FAILED but no exception is thrown.
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.
The intent is the Handler should return FAILED with a sane/consistent exception message that ends up in Stack Trace. I think there's a separate issue that needs to be fixed for that as it's not working reliably.
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.
@rjlohan So which of these asserts should I use?
assertThatThrownBy(() -> handler.handleRequest(proxy, request, new CallbackContext(), proxyClient, logger))
.isInstanceOf(CfnAlreadyExistsException.class);or
response = handler.handleRequest(proxy, request, new CallbackContext(), proxyClient, logger);
assertThat(response).isNotNull();
assertThat(response.getStatus()).isEqualTo(OperationStatus.FAILED);
assertThat(response.getErrorCode()).isEqualTo(HandlerErrorCode.AlreadyExists);I've seen plenty of examples of the former but according to your suggestion we should use the latter?
Issue #, if available: #265
Description of changes:
CreateHandlerandDeleteHandlerhave fixed pre execution checks which add on the main call graph - codegen - create/delete handler pre execution check #265By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.