From 96075bf354f73116ddb2ea9e0ae25d17cb7582b8 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 16 Feb 2018 10:39:46 +0100 Subject: [PATCH] chore(XHRUpload): fix getResponseError signature --- website/src/docs/xhrupload.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/docs/xhrupload.md b/website/src/docs/xhrupload.md index 8b550b665..5df6e893d 100644 --- a/website/src/docs/xhrupload.md +++ b/website/src/docs/xhrupload.md @@ -101,7 +101,7 @@ getResponseData (xhr) { } ``` -### `getResponseError(xhr)` +### `getResponseError(xhr.responseText, xhr)` If the upload endpoint responds with a non-2xx status code, the upload is assumed to have failed. The endpoint might have responded with some information about the error, though. @@ -110,7 +110,7 @@ Pass in a `getResponseError` function to extract error data from the `XMLHttpReq For example, if the endpoint responds with a JSON object containing a `{ message }` property, this would show that message to the user: ```js -getResponseError (xhr) { +getResponseError (responseText, xhr) { return new Error(JSON.parse(xhr.response).message) } ```