I'm upgrading my application form an old version o...
# support-questions-legacy
t
I'm upgrading my application form an old version of super tokens and I'm currently using this code block for error detection. Is there an equivalent in the latest version of the Node NPM package?
Copy code
if (superTokens.Error.isErrorFromAuth(err)) {
        switch (err.errType) {
          case superTokens.Error.GENERAL_ERROR:
            res.status(500).json({ error: 'Internal server error' })
            break
          case superTokens.Error.UNAUTHORISED:
          case superTokens.Error.TRY_REFRESH_TOKEN:
            res.status(440).json({ error: 'Reauthentiation required' })
            break
          default:
            res.status(500).json({ error: 'Internal server error' })
        }
      }