js: fix OperationQueue error handling
When an exception is raised, `response.json()` may have been called already. In that case, when accessing `response.text()` in the error handler, a "Response.text: Body has already been consumed." error will be raised.
This commit is contained in:
parent
c848fc6d00
commit
50cafc033f
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ async function handleError({ response, message }, reject) {
|
|||
try {
|
||||
const {
|
||||
errors: [message]
|
||||
} = await response.json();
|
||||
} = await response.clone().json();
|
||||
reject(message);
|
||||
} catch {
|
||||
reject(await response.text());
|
||||
|
|
Loading…
Reference in a new issue