Skip to content

Commit

Permalink
[webui] proper error handling for changing review state
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jun 23, 2014
1 parent 5385caa commit 3ff827c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ def modify_review
elsif state.nil?
flash[:error] = "Unknown state to set"
else
req.permission_check_change_review!(opts)
req.change_review_state(state, opts)
begin
req.permission_check_change_review!(opts)
req.change_review_state(state, opts)
rescue BsRequestPermissionCheck::ReviewChangeStateNoPermission
flash[:error] = "Not permitted to change review state: #{e.message}"
rescue APIException => e
flash[:error] = "Unable changing review state: #{e.message}"
end
end

redirect_to :action => 'show', :id => req.id
Expand Down

0 comments on commit 3ff827c

Please sign in to comment.