Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Updated `Template.aliasExists` error type (#1079)
Mish Ushakov31670f4068df
diff --git a/.changeset/public-views-roll.md b/.changeset/public-views-roll.mdnew file mode 100644index 000000000..bd07f4117--- /dev/null+++ b/.changeset/public-views-roll.md@@ -0,0 +1,6 @@+---+'@e2b/python-sdk': patch+'e2b': patch+---++updates template alias error typediff --git a/packages/js-sdk/src/template/buildApi.ts b/packages/js-sdk/src/template/buildApi.tsindex 75d15df0e..c5e8ebbbb 100644--- a/packages/js-sdk/src/template/buildApi.ts+++ b/packages/js-sdk/src/template/buildApi.ts@@ -1,6 +1,6 @@import { ApiClient, handleApiError, paths } from '../api'import { stripAnsi } from '../utils'-import { BuildError, FileUploadError } from '../errors'+import { BuildError, FileUploadError, TemplateError } from '../errors'import { LogEntry } from './logger'import { getBuildStepIndex, tarFileStreamUpload } from './utils'@@ -212,7 +212,7 @@ export async function checkAliasExists(}// Handle other errors- const error = handleApiError(aliasRes, BuildError)+ const error = handleApiError(aliasRes, TemplateError)if (error) {throw error}diff --git a/packages/python-sdk/e2b/template_async/build_api.py b/packages/python-sdk/e2b/template_async/build_api.pyindex f8f9924d1..84d3672e5 100644--- a/packages/python-sdk/e2b/template_async/build_api.py+++ b/packages/python-sdk/e2b/template_async/build_api.py@@ -20,7 +20,7 @@ from e2b.api.client.models import (TemplateBuild,Error,)-from e2b.exceptions import BuildException, FileUploadException+from e2b.exceptions import BuildException, FileUploadException, TemplateExceptionfrom e2b.template.logger import LogEntryfrom e2b.template.types import TemplateTypefrom e2b.template.utils import get_build_step_index, tar_file_stream@@ -229,7 +229,7 @@ async def check_alias_exists(client: AuthenticatedClient, alias: str) -> bool:# Handle other errorsif res.status_code >= 300:- raise handle_api_exception(res, BuildException)+ raise handle_api_exception(res, TemplateException)# If we get Ok with data, you are owner and the alias existsreturn res.parsed is not Nonediff --git a/packages/python-sdk/e2b/template_sync/build_api.py b/packages/python-sdk/e2b/template_sync/build_api.pyindex 4d560b21d..459243430 100644--- a/packages/python-sdk/e2b/template_sync/build_api.py+++ b/packages/python-sdk/e2b/template_sync/build_api.py@@ -20,7 +20,7 @@ from e2b.api.client.models import (TemplateBuild,Error,)-from e2b.exceptions import BuildException, FileUploadException+from e2b.exceptions import BuildException, FileUploadException, TemplateExceptionfrom e2b.template.logger import LogEntryfrom e2b.template.types import TemplateTypefrom e2b.template.utils import get_build_step_index, tar_file_stream@@ -226,7 +226,7 @@ def check_alias_exists(client: AuthenticatedClient, alias: str) -> bool:# Handle other errorsif res.status_code >= 300:- raise handle_api_exception(res, BuildException)+ raise handle_api_exception(res, TemplateException)# If we get Ok with data, you are owner and the alias existsreturn res.parsed is not None