Skip to content

Commit 489df72

Browse files
Thomas Nardonefacebook-github-bot
authored andcommitted
Better error message for invalid response blob (#43069)
Summary: Pull Request resolved: #43069 Changelog: [General][Changed] - Add info to invalid blob response error Reviewed By: christophpurrer Differential Revision: D53829400 fbshipit-source-id: 17b1dbb3cacf8368098b0b639e8d10aa9bd28d03
1 parent cb2b265 commit 489df72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-native/Libraries/Network/XMLHttpRequest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): any) {
248248
} else if (this._response === '') {
249249
this._cachedResponse = BlobManager.createFromParts([]);
250250
} else {
251-
throw new Error(`Invalid response for blob: ${this._response}`);
251+
throw new Error(
252+
'Invalid response for blob - expecting object, was ' +
253+
`${typeof this._response}: ${this._response}`,
254+
);
252255
}
253256
break;
254257

0 commit comments

Comments
 (0)