Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54827

throwCurrectJSException fails to pull an error code from the JSContext

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization
    • ALL
    • 21

      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: