Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[chore] attempt to fix exception in error handling

Eric Schubertce278c79ad55
diff --git a/app/controllers/oauth_clients_controller.rb b/app/controllers/oauth_clients_controller.rb
index 2ba8adeb7dd..90804313f79 100644
--- a/app/controllers/oauth_clients_controller.rb
+++ b/app/controllers/oauth_clients_controller.rb
@@ -118,6 +118,10 @@ class OAuthClientsController < ApplicationController
end
def set_oauth_errors(service_result)
+ if service_result.errors.is_a?(::Storages::StorageError)
+ service_result.errors = service_result.errors.to_active_model_errors
+ end
+
flash[:error] = ["#{t(:'oauth_client.errors.oauth_authorization_code_grant_had_errors')}:"]
service_result.errors.each do |error|
flash[:error] << "#{t(:'oauth_client.errors.oauth_reported')}: #{error.full_message}"