Skip to content

Commit

Permalink
Fix autoPause required error options object
Browse files Browse the repository at this point in the history
  • Loading branch information
dobrac committed Feb 18, 2025
1 parent 7a61bda commit 4258d99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/js-sdk/src/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ export class Sandbox extends SandboxApi {
templateOrOpts?: SandboxOpts | string,
opts?: SandboxOpts
): Promise<InstanceType<S>> {
if (!opts?.autoPause) {
throw new Error('autoPause must be set to true when creating a sandbox')
}

const { template, sandboxOpts } =
typeof templateOrOpts === 'string'
? { template: templateOrOpts, sandboxOpts: opts }
: { template: this.defaultTemplate, sandboxOpts: templateOrOpts }

if (!sandboxOpts?.autoPause) {
throw new Error('autoPause must be set to true when creating a sandbox')
}

const config = new ConnectionConfig(sandboxOpts)

const sandboxId = config.debug
Expand Down

0 comments on commit 4258d99

Please sign in to comment.