Skip to content
Snippets Groups Projects
Commit 1898cb03 authored by Fatih Acet's avatar Fatih Acet
Browse files

Added global ajax error handler to show a flash notification for failed requests.

parent 2527ae6c
No related branches found
No related tags found
1 merge request!4797Global Ajax error handler
Pipeline #
Loading
Loading
@@ -145,6 +145,7 @@ v 8.9.0 (unreleased)
- Filter parameters for request_uri value on instrumented transactions.
- Remove duplicated keys add UNIQUE index to keys fingerprint column
- ExtractsPath get ref_names from repository cache, if not there access git.
- Show a flash warning about the error detail of XHR requests which failed with status code 404 and 500
- Cache user todo counts from TodoService
- Ensure Todos counters doesn't count Todos for projects pending delete
- Add left/right arrows horizontal navigation
Loading
Loading
Loading
Loading
@@ -185,6 +185,15 @@ $ ->
else
buttons.enable()
 
$(document).ajaxError (e, xhrObj, xhrSetting, xhrErrorText) ->
if xhrObj.status is 401
new Flash 'You need to be logged in.', 'alert'
else if xhrObj.status in [ 404, 500 ]
new Flash 'Something went wrong on our end.', 'alert'
# Show/Hide the profile menu when hovering the account box
$('.account-box').hover -> $(@).toggleClass('hover')
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment