[SERVER-54827] throwCurrectJSException fails to pull an error code from the JSContext Created: 26/Feb/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Hana Pearlman Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:
Linked BF Score: 21

 Description   

There seems to be a bug around the mozjs/exception.cpp code, specifically in the path starting at throwCurrectJSException() where it can fail to pull an error code/message from the JSContext. One example of this bug (and details for how to repro) is in the linked BF ticket.

One potential fix is in JSErrorReportToStatus(). The given JSErrorReport has a message field that can take the form "error: {stringified BSONObj describing the error}". If the BSONObj part of this message field was parsed in this function, then a status could easily be created from this BSONObj with the original error code and message.

We're not sure of the effect this would have on other JS tests or whether there are other cases where this behavior is not desirable.


Generated at Thu Feb 08 05:34:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.