Fetch: more robust error handling

This commit is contained in:
cgfhtw
2024-03-11 09:46:59 +01:00
parent 011b4a83eb
commit d259c0d35c
+3 -1
View File
@@ -99,8 +99,10 @@ export const CoreFetchCmpt = {
*
*/
errorHandler: function(error) {
if (error.response.data.retval)
if (error.response?.data?.retval)
this.setError(error.response.data.retval);
else if (error.data?.message)
this.setError(error.data.message);
else
this.setError(error.message);
},