mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Improve error message of fetch
when xhr.onerror occurs (#3003)
* Ensure fetch-tests fail (instead of timeout) on failure * Standardize failure handling in fetch-tests * Improve flawed failure condition of test_fetch_json Previously, the assertion was always true * Implement better error message for for xhr.onerror within fetch
This commit is contained in:

committed by
Vladimir Enchev

parent
329817a2ba
commit
06c04c41fb
@ -310,8 +310,8 @@
|
||||
resolve(new Response(xhr.responseText, options))
|
||||
}
|
||||
|
||||
xhr.onerror = function () {
|
||||
reject(new TypeError('Network request failed'))
|
||||
xhr.onerror = function (error) {
|
||||
reject(new TypeError(['Network request failed:', error.message].join(' ')))
|
||||
}
|
||||
|
||||
xhr.open(request.method, request.url, true)
|
||||
|
Reference in New Issue
Block a user