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
window.addEventListener(
'apiErrorEvent',
evt => {
console.log(evt.detail.errors);
},
false
);