diff --git a/packages/core/src/anchor/ethereum/ethereum-anchor-service.ts b/packages/core/src/anchor/ethereum/ethereum-anchor-service.ts index 0a8da5d276..2e38163677 100644 --- a/packages/core/src/anchor/ethereum/ethereum-anchor-service.ts +++ b/packages/core/src/anchor/ethereum/ethereum-anchor-service.ts @@ -133,8 +133,8 @@ export class EthereumAnchorService implements AnchorService { async close(): Promise { this.#logger.debug(`Closing EthereumAnchorService`) - await this.#cas.close() - await this.#store.close() + await this.#cas?.close() + await this.#store?.close() await this.#loop?.stop() } } diff --git a/packages/core/src/ceramic.ts b/packages/core/src/ceramic.ts index 6c0585c3d6..16bea35916 100644 --- a/packages/core/src/ceramic.ts +++ b/packages/core/src/ceramic.ts @@ -486,6 +486,7 @@ export class Ceramic implements StreamReaderWriter, StreamStateLoader { await this._startupChecks() } catch (err) { this._logger.err(err) + await this.close() throw err } }