Project

General

Profile

action #176214

Updated by dheidler 3 months ago

In https://progress.opensuse.org/issues/166310, all the jquery `$.ajax()` calls were replaced by `fetch()`, which makes the error reporting a bit trickier when indicating an error via both http status code and `error` field in the JSON response. 

 Currently - when the server returns an error - only something like this is e.g. shown when saving a needle and there is an issue with the git push on the server: 

 ![](clipboard-202501271429-dgvly.png) 

 Of course this is what it actually should look like (the information is actually sent in the JSON `error` field): field: 

 ![](clipboard-202501271431-ryaj1.png) 

 This is due to the fact that in the current logic first the HTTP Status code is evaluated and if it is not 2xx, only the Status text (empty in this case) is shown but not the json error. 
 While we could also make better use of the status text, we should fix all the `fetch()` calls. 

 I created https://github.com/os-autoinst/openQA/pull/6139 to show how it can be done for saving a needle, but this needs to be applied to all the fetch/fetchWithCSRF calls.

Back