@mastra/e2b 0.13.0-alpha.1 → 0.13.0-alpha.2

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.cjs CHANGED
@@ -862,10 +862,15 @@ var E2BSandbox = class E2BSandbox extends _mastra_core_workspace.MastraSandbox {
862
862
  if (!isTemplateUnusable(createError)) throw createError;
863
863
  const namedSpec = this.templateSpec && isNamedTemplateSpec(this.templateSpec) ? this.templateSpec : this._resolvedNamedSpec;
864
864
  if (namedSpec) {
865
+ const { fallbackTemplate } = namedSpec;
866
+ if (fallbackTemplate === false) {
867
+ this._resolvedTemplateId = void 0;
868
+ this.logger.error(`${LOG_PREFIX} Creating from '${resolvedTemplateId}' failed (fallback disabled): ${createError}`);
869
+ throw createError;
870
+ }
865
871
  this.logger.warn(`${LOG_PREFIX} Creating from '${resolvedTemplateId}' failed, retrying on fallback: ${createError}`);
866
872
  this._resolvedTemplateId = void 0;
867
- const spec = namedSpec;
868
- const fallbackId = resolvedTemplateId === spec.ref ? await this.resolveFallbackTemplate(spec.fallbackTemplate) : await this.buildOrReuseDefaultTemplate();
873
+ const fallbackId = resolvedTemplateId === namedSpec.ref ? await this.resolveFallbackTemplate(fallbackTemplate) : await this.buildOrReuseDefaultTemplate();
869
874
  try {
870
875
  sdkSandbox = await createFromTemplate(fallbackId);
871
876
  this._resolvedTemplateId = fallbackId;
@@ -1386,6 +1391,11 @@ var E2BSandbox = class E2BSandbox extends _mastra_core_workspace.MastraSandbox {
1386
1391
  this._resolvedTemplateId = ref;
1387
1392
  return ref;
1388
1393
  } catch (error) {
1394
+ if (fallbackTemplate === false) {
1395
+ this._resolvedTemplateId = void 0;
1396
+ this.logger.error(`${LOG_PREFIX} Template '${ref}' resolution failed (fallback disabled): ${error}`);
1397
+ throw error;
1398
+ }
1389
1399
  this.logger.warn(`${LOG_PREFIX} Template '${ref}' resolution failed, falling back: ${error}`);
1390
1400
  return await this.resolveFallbackTemplate(fallbackTemplate);
1391
1401
  }