How to handle the error so that if the user does not provide a token, then an UnauthorizedException is thrown.

At the moment I am getting this error:

```
{
    "statusCode": 500,
    "message": "Internal server error"
}

```

**ts:**

```
  canActivate(context: ExecutionContext) {
    const request = context.switchToHttp().getRequest();
    try {
      const jwt = request.headers.authorization.split(' ')[1];

      if (!jwt) {
        throw new UnauthorizedException('Token is not provided.');
      }

      return this.jwtService.verify(jwt);
    } catch (e) {
      return false;
    }
  }

```