Skip to content

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

Description

@dev-mansonthomas

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") ;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions