Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-844

Have a unique error code for each error message

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      Be able to distinguish authentication errors by their code.

      Expected Results

      Have a unique error code for every error message.

      Actual Results

      When logging in realm with a JWT token, I can receive the following error codes (among others):

      {code:46, message: "user disabled"}
      {code:47, message: "(something about authentication failed...) ; token is expired"}
      {code:47, message: "failed to lookup key for kid=..."}
      

      The last one occurs when I try to log in my production realm with a staging JWT, for instance.

      It doesn't seem logic to me to have the same error code for two different errors, especially since my app should behave differently in case I get a 47 error code:

      • "failed to lookup..." => logout, clear token cache
      • "token expired" => renew token, then retry to log in Realm

      Version of Realm and Tooling

      • Realm JS SDK Version: 10.0.0-rc.1
      • Node or React Native: React Native
      • Client OS & Version: macOS 10.15.7
      • Which debugger for React Native: None

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: