Try Catch in controller


Hi, can anyone explain me why the following action send the entire exception to the client (when the token isn’t valid or isn’t present) instead of enter in the catch block ?

async self({ response, auth }) {
    try {
      return await auth.getUser();
    catch(error) {
      return response.status(401).send();


Are you using the auth middleare?


This was exactly this, I’m so dumb, I totally forgot that I added it for this route. Thanks