sparse-intern-71089
10/10/2023, 8:56 AMdry-keyboard-94795
10/10/2023, 9:27 AMsys.exit(1)
after the log.error.
To make it cleaner, wrap it in a function:
def fatal(msg: str, resource: pulumi.Resource = None):
log.error(msg, resource=resource)
sys.exit(1)
dry-keyboard-94795
10/10/2023, 9:32 AMmsg = str(exc)
log.error(msg)
throw exc
Though I'm not sure how that will look visuallyambitious-father-68746
10/10/2023, 10:01 AMambitious-father-68746
10/10/2023, 10:02 AMerror: This is my custom error, it's all gone downhill
error: Program failed with an unhandled exception:
...
ambitious-father-68746
10/10/2023, 10:02 AMambitious-father-68746
10/10/2023, 10:02 AMdry-keyboard-94795
10/10/2023, 10:05 AMambitious-father-68746
10/10/2023, 10:09 AMos._exit()
😅dry-keyboard-94795
10/10/2023, 10:10 AMdry-keyboard-94795
10/10/2023, 10:10 AMpulumi.RunError
as the base of your exceptions:
https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.RunErrorambitious-father-68746
10/10/2023, 10:12 AMambitious-father-68746
10/10/2023, 10:30 AMpulumi.RunError
you essentially get what I want, which is a pretty error message followed by a clean exit, without a stack trace. 👍