diff options
Diffstat (limited to 'overrides')
-rw-r--r-- | overrides/endless_private/connection_test.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/overrides/endless_private/connection_test.js b/overrides/endless_private/connection_test.js index 24a2a3c..ce2e0f9 100644 --- a/overrides/endless_private/connection_test.js +++ b/overrides/endless_private/connection_test.js @@ -7,6 +7,8 @@ const Gio = imports.gi.Gio; // and are called in their relevent outcome cases. If the ping test completed, // the userData will be passed to the callbacks. Additionally, the errorCallback // will recieve the error as the first argument. +// If an errorCallback is not provided, errors will be re-thrown (with the +// exception of a Gio.ResolverError, which is a connection failure). function doConnectionTestAsync(hostname, scheme, port, connectionSuccessCallback, connectionFailureCallback, errorCallback) { @@ -33,6 +35,8 @@ function doConnectionTestAsync(hostname, scheme, port, connectionSuccessCallback connectionFailureCallback(userData); } else if (errorCallback) { errorCallback(err, userData); + } else { + throw err; } } }); |