Parse App errors from CloudExecutables that use sub-shell #32997
Labels
@aws-cdk/toolkit
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Errors thrown by CDK Apps are just printed to stdout/stderr by the subprocess. we should intercept, capture and re-throw the error. Instead this should be thrown by
toolkit.synth
directly.We need to pass a magic env variable
CDK_SERIALIZE_ERRORS
to the cdk app. When this variable is set, then we add the following snippet:This needs to somehow announce to the parent process that the app is no sending a JSON serialized error through the channel.
In the CLI/Toolkit we need to detect this and NOT print regularly. Instead we deserialize the error, recreate it to a proper Node exception and re throw it (toolkit). In the CLI we can also add some nice formatting on the error.
The text was updated successfully, but these errors were encountered: