fix: set error message in runTask & executeJob (#634)

* fix: set error message in runTask & executeJob

* add changeset
This commit is contained in:
Hemachandar
2023-10-26 16:16:09 +05:30
committed by GitHub
parent f8e034c190
commit c4533c36cb
3 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/sdk": patch
---
set error messages in runTask and executeJob
+2 -1
View File
@@ -818,8 +818,9 @@ export class IO {
error: parsedError.data,
});
} else {
const message = typeof error === "string" ? error : JSON.stringify(error);
await this._apiClient.failTask(this._id, task.id, {
error: { message: JSON.stringify(error), name: "Unknown Error" },
error: { name: "Unknown error", message },
});
}
+2 -1
View File
@@ -860,9 +860,10 @@ export class TriggerClient {
return { status: "ERROR", error: errorWithStack.data };
}
const message = typeof error === "string" ? error : JSON.stringify(error);
return {
status: "ERROR",
error: { message: "Unknown error" },
error: { name: "Unknown error", message },
};
}
}