js: don't attempt to log unexistent statusText
This commit is contained in:
parent
99b836da2c
commit
071d9145ca
1 changed files with 4 additions and 1 deletions
|
@ -57,7 +57,10 @@ export function ajax(options) {
|
|||
resolve({ response, statusText, xhr });
|
||||
},
|
||||
error: (response, statusText, xhr) => {
|
||||
let error = new Error(`Erreur ${xhr.status} : ${statusText}`);
|
||||
// NB: on HTTP/2 connections, statusText is always empty.
|
||||
let error = new Error(
|
||||
`Erreur ${xhr.status}` + (statusText ? ` : ${statusText}` : '')
|
||||
);
|
||||
Object.assign(error, { response, statusText, xhr });
|
||||
reject(error);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue