From bb98e5cb1e8d736a4b4a57a367fc70ae9ee036a7 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Sat, 13 Jun 2020 01:36:54 +0100 Subject: [PATCH] update docs about error.isNetworkError --- website/src/docs/uppy.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/src/docs/uppy.md b/website/src/docs/uppy.md index c105a79e1..89a176b75 100644 --- a/website/src/docs/uppy.md +++ b/website/src/docs/uppy.md @@ -753,6 +753,18 @@ uppy.on('upload-error', (file, error, response) => { }) ``` +If the error is related to network conditions — endpoint unreachable due to firewall or ISP blockage, for instance — the error will have `error.isNetworkError` property set to `true`. Here’s how you can check for network errors: + +``` javascript +uppy.on('upload-error', (file, error, response) => { + if (error.isNetworkError) { + // Let your users know that file upload could have failed + // due to firewall or ISP issues + alertUserAboutPossibleFirewallOrISPIssues(error) + } +}) +``` + ### `upload-retry` Fired when an upload has been retried (after an error, for example):