Skip to content

Commit

Permalink
Merge pull request #13927 from eduardoj/fix/replace_exception_with_st…
Browse files Browse the repository at this point in the history
…andarderror

Replace rescuing `Exception` with `StandardError`
  • Loading branch information
danidoni committed Mar 3, 2023
2 parents 4ce8a0e + dfd5795 commit 339a502
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/person_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def internal_register
email, password: password, note: note, status: status)

render_ok
rescue Exception => e
rescue StandardError => e
# Strip passwords from request environment and re-raise exception
request.env['RAW_POST_DATA'] = request.env['RAW_POST_DATA'].sub(%r{<password>(.*)</password>}, '<password>STRIPPED<password>')
raise e
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/public_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def check_package_access(project_name, package_name, use_source = true)
allowed = Rails.cache.fetch(key, expires_in: 30.minutes) do
Package.get_by_project_and_name(project_name, package_name, use_source: false)
true
rescue Exception
rescue StandardError
false
end
raise Package::UnknownObjectError, "#{project_name} / #{package_name} " unless allowed
Expand Down

0 comments on commit 339a502

Please sign in to comment.