Skip to content
Snippets Groups Projects
Verified Commit 13ca87b4 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

fixup! Bug 42247: Android helpers for the TorProvider

Bug 42479: Improve TorConnect error handling.

Pass the new TorConnect error codes to Android.
parent 00c53294
Branches
Tags
1 merge request!968Draft: Bug 42479: Improve TorConnect error handling
......@@ -165,10 +165,12 @@ public class TorIntegrationAndroid implements BundleEventListener {
listener.onBootstrapComplete();
}
} else if (EVENT_BOOTSTRAP_ERROR.equals(event)) {
String code = message.getString("code");
String msg = message.getString("message");
String details = message.getString("details");
String phase = message.getString("phase");
String reason = message.getString("reason");
for (BootstrapStateChangeListener listener: mBootstrapStateListeners) {
listener.onBootstrapError(msg, details);
listener.onBootstrapError(code, msg, phase, reason);
}
} else if (EVENT_TOR_LOGS.equals(event)) {
String msg = message.getString("message");
......@@ -577,7 +579,7 @@ public class TorIntegrationAndroid implements BundleEventListener {
void onBootstrapStateChange(String state);
void onBootstrapProgress(double progress, String status, boolean hasWarnings);
void onBootstrapComplete();
void onBootstrapError(String message, String details);
void onBootstrapError(String code, String message, String phase, String reason);
void onSettingsRequested();
}
......
......@@ -118,8 +118,10 @@ class TorAndroidIntegrationImpl {
case lazy.TorConnectTopics.BootstrapError:
lazy.EventDispatcher.instance.sendRequest({
type: EmittedEvents.bootstrapError,
code: subj.wrappedJSObject.code ?? "",
message: subj.wrappedJSObject.message ?? "",
details: subj.wrappedJSObject.details ?? "",
phase: subj.wrappedJSObject.details?.details?.phase ?? "",
reason: subj.wrappedJSObject.details?.details?.reason ?? "",
});
break;
case lazy.TorProviderTopics.TorLog:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment