We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
すべてのOctKitの呼び出しについて、Octokit::Error例外を捕捉してCommandFailed例外をraiseしてほしいです。目的はRedmineの画面にエラーメッセージが表示されるようにするためです。
以下、サンプルです。
diff --git a/lib/redmine/scm/adapters/github_adapter.rb b/lib/redmine/scm/adapters/github_adapter.rb index 647ba51..63e1c3b 100644 --- a/lib/redmine/scm/adapters/github_adapter.rb +++ b/lib/redmine/scm/adapters/github_adapter.rb @@ -37,6 +37,11 @@ module Redmine end end @branches.sort! + rescue Octokit::Error => e + logger.error "scm: github: error: #{e.message}" + gh_error = JSON.parse(e.response_body.to_s)['message'].presence + emsg = gh_error ? 'error response from GitHub: ' + gh_error : '' + raise CommandFailed, emsg end def entries(path=nil, identifier=nil, options={})
The text was updated successfully, but these errors were encountered:
refs #1 Octokit::Errorのエラーハンドリングを追加
e447984
Merge pull request #1 from farend-biz/update/main
2821315
Update/main
No branches or pull requests
すべてのOctKitの呼び出しについて、Octokit::Error例外を捕捉してCommandFailed例外をraiseしてほしいです。目的はRedmineの画面にエラーメッセージが表示されるようにするためです。
以下、サンプルです。
The text was updated successfully, but these errors were encountered: