Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modal-js/src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ export class Sandbox {
}
if (resp.taskResult) {
throw new Error(
`Sandbox ${this.sandboxId} has already completed with result: ${resp.taskResult}`,
`Sandbox ${this.sandboxId} has already completed with result: ${JSON.stringify(resp.taskResult)}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Serialization Errors Mask Real Problem Messages

JSON.stringify(resp.taskResult) can throw a TypeError if the protobuf object contains circular references, BigInt values, or other non-serializable properties. This would replace the intended error message with a confusing serialization error. The codebase shows awareness of this risk in grpc_mock.ts where JSON.stringify is wrapped in try-catch with a fallback to String().

Fix in Cursor Fix in Web

);
}
this.#taskId = resp.taskId;
Expand Down
Loading