question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnauthorizedException handled internally

See original GitHub issue

Following the NestJS JWT auth tutorial from the documentation I noticed that the UnauthorizedException is handled “internally”. Instead of printing

You’ll get {"statusCode":500,"message":"Internal server error"} along with this log message [Nest] #14156 14:59:46 - error: [root] { statusCode: 401, error: 'Unauthorized' }

It should print that error as JSON response along with the right http response code right?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, May 7, 2018

Also, make sure to get rid of internal @nestjs/common package installed by @nestjs/passport (full path: node_modules/@nestjs/passport/node_modules/@nestjs/common)

0reactions
kamilmysliwieccommented, Apr 9, 2020

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnauthorizedException is deliver as Internal Server Error
This filter is exported from auth-library, so UnauthorizedException indicates on the same object as AuthGuard. import { ArgumentsHost, Catch, ...
Read more >
How to Handle Unathorized Exception
SharePoint “handles” Access denied exceptions by catching the exception internally and then redirecting the user to a landing page where ...
Read more >
15.7. Exception Handling - Red Hat Customer Portal
Unauthorized. Security exception thrown if you are using RESTEasy's annotation-based role-based security. InternalServerErrorException, 500, Internal Server ...
Read more >
How to handle unauthorized exception when adding a filter to ...
This article explains the topic, How to handle unauthorized exception when adding a filter to WinForms GridGroupingControl?
Read more >
An opinionated way to consistent Error Handling in ASP.NET ...
It is common to see that popular HTTP error status codes such as 400 Bad Request , 401 Unauthorized , 404 Not found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found