I'm using custom-tools and I have a simple function using Nova.request().
async getRoom() {
const apiUrl = '/api/room';
this.loading = true;
await Nova.request().get(apiUrl)
.then(response => {
// To do
})
},
The thing is Nova auto shows a toast error message when the API gets error 500.
If I use Axios or change the HTTP response in the back-end when error then the message will not be shown.
Such as: message => $e->getMessage() to xxx => $e->getMessage()
Is this a feature or does my code have bugs? in this custom tool, I don't use any Nova.error.
And seems like it only handles error 500. When error 404 I don't see it show toast error.
That's the expected behavior since setupAxios() would register all the response interceptors. You should use your own Axios instance to avoid this if you need it.
I'm using custom-tools and I have a simple function using
Nova.request()
.The thing is Nova auto shows a toast error message when the API gets error 500.
If I use Axios or change the HTTP response in the back-end when error then the message will not be shown. Such as:
message => $e->getMessage()
toxxx => $e->getMessage()
Is this a feature or does my code have bugs? in this custom tool, I don't use any
Nova.error
.And seems like it only handles error 500. When error 404 I don't see it show toast error.