Skip to content
New issue

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

Set X-Opensuse-Errorcode for pundit errors #15898

Merged
merged 1 commit into from Mar 27, 2024

Conversation

hennevogel
Copy link
Member

As we do in ApplicationController#render_error

As we do in ApplicationController#render_error
@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Mar 27, 2024
@hennevogel
Copy link
Member Author

def render_error(opt = {})
# avoid double render error
self.response_body = nil
gather_exception_defaults(opt)
response.headers['X-Opensuse-Errorcode'] = @errorcode
respond_to do |format|
format.xml { render template: 'status', status: @status }
format.json { render json: { errorcode: @errorcode, summary: @summary }, status: @status }
format.html do
flash[:error] = "#{@summary} (#{@errorcode})" unless request.env['HTTP_REFERER']
redirect_back(fallback_location: root_path)
end
end
end

@hennevogel hennevogel merged commit a68cb1e into openSUSE:master Mar 27, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants