sdk
sdk copied to clipboard
Prevent handled errors from being thrown out of the SDK
The integration SDK is currently coded to re-throw some errors that it has handled. This seems to be a collaboration between the SDK and the managed runtime, considering the logger tracks warn
and error
-handled errors to avoid double-logging when the SDK logs and the managed runtime sees a re-thrown error.
https://github.com/JupiterOne/sdk/pull/328/files#r484114539 adds additional code to collaborate with the managed runtime, to help it know that some errors should not be reported to the operator.
It seems good to avoid re-throwing handled errors from the SDK. Only unhandled errors should make it into the managed runtime, which should catch them and report them to the operator as unhandled errors.
It may be necessary to refactor functions such as executeIntegration
to support this approach.