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

fixup! Bug 40597: Implement TorSettings module

Bug 41114: Refactor TorConnect.

Pass only the new state's name to StateCallback.end.
parent f59ddd26
Branches
Tags
1 merge request!938Bug 41114: Fix no-async-promise-executor on TorConnect and general refactor
......@@ -179,7 +179,7 @@ class StateCallback {
async end(nextState) {
lazy.logger.trace(
`Ending state ${this.#state} (to transition to ${nextState.state})`
`Ending state ${this.#state} (to transition to ${nextState})`
);
if (this.#transitioning) {
......@@ -205,7 +205,7 @@ class StateCallback {
lazy.logger.debug(`Calling ${this.#state}'s cleanup, if implemented.`);
if (this.cleanup) {
try {
await this.cleanup(nextState.state);
await this.cleanup(nextState);
lazy.logger.debug(`${this.#state}'s cleanup function done.`);
} catch (e) {
lazy.logger.warn(`${this.#state}'s cleanup function threw.`, e);
......@@ -903,7 +903,7 @@ export const TorConnect = {
args
);
try {
await prevState.end(this._stateHandler);
await prevState.end(newState);
} catch (e) {
// We take for granted that the begin of this state will call us again,
// to request the transition to the error state.
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment