Skip to content

Commit 03884b5

Browse files
committed
Remove fine grained error check
1 parent d46649b commit 03884b5

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

Diff for: CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- `fill` and `fill_structures` argument in `td.Simulation.plot_structures()` and `td.Simulation.plot()` respectively to disable fill and plot outlines of structures only.
1212
- New subpixel averaging option `ContourPathAveraging` applied to dielectric material boundaries.
1313

14-
### Fixed
15-
- Compatibility with `xarray>=2025.03`.
16-
1714
### Changed
1815
- Error message for invalid task ID.
1916

17+
### Fixed
18+
- Compatibility with `xarray>=2025.03`.
19+
2020
## [2.8.1] - 2025-03-20
2121

2222
### Added

Diff for: tests/test_web/test_webapi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
upload,
4040
)
4141
from tidy3d.web.core.environment import Env
42-
from tidy3d.web.core.exceptions import TaskNotFoundError
42+
from tidy3d.web.core.exceptions import WebNotFoundError
4343
from tidy3d.web.core.types import TaskType
4444

4545
TASK_NAME = "task_name_test"
@@ -736,5 +736,5 @@ def test_load_invalid_task_raises(mock_webapi):
736736
json={"error": "Task not found"},
737737
status=404,
738738
)
739-
with pytest.raises(TaskNotFoundError, match="does not exist"):
739+
with pytest.raises(WebNotFoundError, match="Resource not found"):
740740
load(fake_id)

Diff for: tidy3d/web/core/exceptions.py

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ def __init__(self, message: str = None):
1313
log.error(message)
1414

1515

16-
class TaskNotFoundError(WebError):
17-
"""Raised when a requested task ID does not exist on the server."""
18-
19-
pass
20-
21-
2216
class WebNotFoundError(WebError):
2317
"""A generic error indicating an HTTP 404 (resource not found)."""
2418

Diff for: tidy3d/web/core/task_core.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
from botocore.exceptions import ClientError
1313
from pydantic.v1 import Extra, Field, parse_obj_as
1414

15+
import tidy3d as td
16+
1517
from . import http_util
1618
from .cache import FOLDER_CACHE
1719
from .constants import SIM_ERROR_FILE, SIM_FILE_HDF5_GZ, SIM_LOG_FILE, SIMULATION_DATA_HDF5_GZ
1820
from .core_config import get_logger_console
1921
from .environment import Env
20-
from .exceptions import TaskNotFoundError, WebError, WebNotFoundError
22+
from .exceptions import WebError, WebNotFoundError
2123
from .file_util import read_simulation_from_hdf5
2224
from .http_util import http
2325
from .s3utils import download_file, download_gz_file, upload_file
@@ -263,8 +265,10 @@ def get(cls, task_id: str, verbose: bool = True) -> SimulationTask:
263265
"""
264266
try:
265267
resp = http.get(f"tidy3d/tasks/{task_id}/detail")
266-
except WebNotFoundError:
267-
raise TaskNotFoundError(f"The requested task ID '{task_id}' does not exist.")
268+
except WebNotFoundError as e:
269+
td.log.error(f"The requested task ID '{task_id}' does not exist.")
270+
raise e
271+
268272
task = SimulationTask(**resp) if resp else None
269273
return task
270274

0 commit comments

Comments
 (0)