You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have 3 places where we rethrow the original error, but as a new error with additional information.
We had 2 places in the extension where this caused issues, basically:
We are throwing exception of type A
Then we handle this and rethrow this as a new error type B (but retain some of the original error information)
Further up, we check if the error is type A, and do something
However the error is no longer of type A, its a new error.
Again, this was fixed recently in a PR, but we still have at least 3 areas that still do this.
Solutions:
Ensure we do not throw new errors if we had thrown the original error
E.g. instead of throw new WrappedError(localize.DataScience.jupyterNotebookFailure().format(err), err);
We change this to
DonJayamanne
changed the title
Don't use WrappedError for our own errors
Don't use throw new errors when original error was throw by us (we lose original error information)
Mar 9, 2021
We have 3 places where we rethrow the original error, but as a new error with additional information.
We had 2 places in the extension where this caused issues, basically:
Again, this was fixed recently in a PR, but we still have at least 3 areas that still do this.
Solutions:
E.g. instead of
throw new WrappedError(localize.DataScience.jupyterNotebookFailure().format(err), err);
We change this to
This can be converted into a single liner as follows:
Where
WrappedError.from
can do the necessary checking.The text was updated successfully, but these errors were encountered: