Skip to content

Commit a149b5b

Browse files
committed
Adding exception message to return to CFN
1 parent 1ff68f9 commit a149b5b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cloudformation_cli_python_lib/resource.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,16 @@ def print_or_log(message: str) -> None:
222222
progress = e.to_progress_event()
223223
except Exception as e: # pylint: disable=broad-except
224224
print_or_log("Exception caught {0}".format(e))
225-
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)
225+
progress = ProgressEvent.failed(
226+
HandlerErrorCode.InternalFailure,
227+
message=str("Exception caught {0}".format(e)),
228+
)
226229
except BaseException as e: # pylint: disable=broad-except
227230
print_or_log("Base exception caught (this is usually bad) {0}".format(e))
228-
progress = ProgressEvent.failed(HandlerErrorCode.InternalFailure)
231+
progress = ProgressEvent.failed(
232+
HandlerErrorCode.InternalFailure,
233+
message=str("Base exception caught {0}".format(e)),
234+
)
229235

230236
if progress.result:
231237
progress.result = None

0 commit comments

Comments
 (0)