Skip to content
Snippets Groups Projects
Commit 15347e1b 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 7f6ee356
Branches
No related tags found
1 merge request!980Bug 42512: Rebased alpha onto Firefox 115.10.0esr
......@@ -178,7 +178,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) {
......@@ -204,7 +204,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);
......@@ -902,7 +902,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