fix: Provide a better error message when task runner disconnects (no-changelog) (#11442)

This commit is contained in:
Tomi Turtiainen
2024-10-29 12:39:31 +02:00
committed by GitHub
parent 0ab24c814a
commit 4e3681b905
12 changed files with 362 additions and 25 deletions

View File

@@ -60,9 +60,11 @@ export class JsTaskRunnerSandbox {
}
private throwExecutionError(error: unknown): never {
// The error coming from task runner is not an instance of error,
// so we need to wrap it in an error instance.
if (isWrappableError(error)) {
if (error instanceof Error) {
throw error;
} else if (isWrappableError(error)) {
// The error coming from task runner is not an instance of error,
// so we need to wrap it in an error instance.
throw new WrappedExecutionError(error);
}