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

Fix Error Handling in Functions with API Requests #11

Merged
merged 9 commits into from
Mar 17, 2023

Conversation

yutomoriyasu
Copy link
Contributor

  • Use HttpException to catch errors of API requests
  • Return error responses with type and message

Copy link
Contributor

@silent-bayline silent-bayline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1点質問しましたが、他は良さそうです!

setcookie('saasus_refresh_token', $body['refresh_token'], $arr_cookie_options);
return response()->json($body, Response::HTTP_OK);
} catch (\Exception $e) {
if ($e instanceof HttpException) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpException以外のケースがわかってないですが
ログ出力なしで良さそうかだけ確認させてください〜

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ログ出すようにしました!3577e8d

@yutomoriyasu yutomoriyasu merged commit 9339144 into main Mar 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants