Skip to content

Commit

Permalink
[webui] Add values of variables to exception
Browse files Browse the repository at this point in the history
Add the values of variables to the message sent to Errbit
that may cause a "Validation failed: Bs request actions is
invalid" exception in the Webui::RequestController.

This will help to know why issue #3730 happens.

Co-authored-by: Moisés Déniz Alemán <mdeniz@suse.com>
  • Loading branch information
eduardoj and Moisés Déniz Alemán committed Mar 27, 2018
1 parent 3acd715 commit 1acfb29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/app/controllers/webui/request_controller.rb
Expand Up @@ -423,7 +423,10 @@ def forward_request_to(fwd)
end
end
rescue APIException, ActiveRecord::RecordInvalid => e
Airbrake.notify("Failed to forward BsRequest: #{@bs_request.number}: #{req} #{e}")
error_string = "Failed to forward BsRequest: #{@bs_request.number}, error: #{e}, request: #{req.inspect}, params: #{params.inspect}"
error_string << ", action: #{action.inspect}" if defined?(action)
error_string << ", Record errors: #{e.record.errors}" if e.respond_to?(:record)
Airbrake.notify(error_string)
flash[:error] = "Unable to forward submit request: #{e.message}"
return
end
Expand Down

0 comments on commit 1acfb29

Please sign in to comment.