Chimu
Searchโ€ฆ
Event handler

How catch api error

When axios interceptor catch error api fired customEvent with 'apiErrorEvent' name.
Event value contains in .detail field.

Example:

Field error contains in JSON Api sceme or default response
1
window.addEventListener(
2
'apiErrorEvent',
3
evt => {
4
console.log(evt.detail.errors);
5
},
6
false
7
);
8
โ€‹
Copied!
โ€‹