mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Fetch: more robust error handling
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user