@mastra/daytona 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Daytona, DaytonaNotFoundError, SandboxState } from "@daytonaio/sdk";
1
+ import { Daytona, DaytonaGoneError, DaytonaNotFoundError, SandboxState } from "@daytonaio/sdk";
2
2
  import { MastraSandbox, ProcessHandle, SandboxNotReadyError, SandboxProcessManager, UnsupportedStdinCloseError, assertModesUnsupported } from "@mastra/core/workspace";
3
3
  import { createHash, randomUUID } from "crypto";
4
4
  //#region src/utils/compact.ts
@@ -966,11 +966,15 @@ var DaytonaSandbox = class DaytonaSandbox extends MastraSandbox {
966
966
  async destroy() {
967
967
  if (this._sandbox && this._daytona) try {
968
968
  await this._daytona.delete(this._sandbox);
969
- } catch {}
969
+ } catch (error) {
970
+ if (!(error instanceof DaytonaNotFoundError) && !(error instanceof DaytonaGoneError)) throw error;
971
+ }
970
972
  else if (!this._sandbox) try {
971
973
  const orphan = await this.lookupDetachedSandbox();
972
974
  if (orphan) await this._daytona.delete(orphan);
973
- } catch {}
975
+ } catch (error) {
976
+ if (!(error instanceof DaytonaNotFoundError) && !(error instanceof DaytonaGoneError)) throw error;
977
+ }
974
978
  this._sandbox = null;
975
979
  this._daytonaSandboxId = void 0;
976
980
  this._daytona = null;