Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all RouteAction use tryCatch to have more clear error for debugging #173

Open
dev-mansonthomas opened this issue May 15, 2022 · 0 comments

Comments

@dev-mansonthomas
Copy link
Owner

dev-mansonthomas commented May 15, 2022

exemple of good implementation :

No need to include the decodedToken in the log->error() arguments, it's already in the log context.

    try
    {
      $validToken = $this->spotfireAccessDBService->grantAccess($userId ,$ulId,   $this->settings['appSettings']['sessionLength' ]);

      $this->response->getBody()->write(json_encode(new GetSpotfireTokenResponse($validToken->token, $validToken->token_expiration)));

      return $this->response;
    }
    catch(Throwable $exception)
    {
      $this->logger->error("Error while getting Spotfire access token",["validToken"=>$validToken]);
      return $this->response->withStatus(500, "Error while getting Spotfire access token") ;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant