File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55from nats .js import JetStreamContext
66from nats .js .errors import BucketNotFoundError , ObjectNotFoundError
77from nats .js .object_store import ObjectStore
8- from taskiq import AsyncResultBackend
8+ from taskiq import AsyncResultBackend , ResultGetError
99from taskiq .abc .serializer import TaskiqSerializer
1010from taskiq .compat import model_dump , model_validate
1111from taskiq .result import TaskiqResult
1212from taskiq .serializers import PickleSerializer
1313
14- from taskiq_nats .exceptions import ResultIsMissingError
15-
1614_ReturnType = TypeVar ("_ReturnType" )
1715
1816
@@ -109,7 +107,7 @@ async def get_result(
109107 name = task_id ,
110108 )
111109 except ObjectNotFoundError as exc :
112- raise ResultIsMissingError from exc
110+ raise ResultGetError from exc
113111
114112 if not self .keep_results :
115113 await self .object_store .delete (
Original file line number Diff line number Diff line change 22from typing import Any , List , TypeVar
33
44import pytest
5- from taskiq import TaskiqResult
5+ from taskiq import ResultGetError , TaskiqResult
66
77from taskiq_nats import NATSObjectStoreResultBackend
8- from taskiq_nats .exceptions import ResultIsMissingError
98
109_ReturnType = TypeVar ("_ReturnType" )
1110pytestmark = pytest .mark .anyio
@@ -64,7 +63,7 @@ async def test_failure_backend_result(
6463 task_id : str ,
6564) -> None :
6665 """Test exception raising in `get_result` method."""
67- with pytest .raises (expected_exception = ResultIsMissingError ):
66+ with pytest .raises (expected_exception = ResultGetError ):
6867 await nats_result_backend .get_result (task_id = task_id )
6968
7069
@@ -85,7 +84,7 @@ async def test_success_backend_default_result_delete_res(
8584 )
8685 await backend .get_result (task_id = task_id )
8786
88- with pytest .raises (expected_exception = ResultIsMissingError ):
87+ with pytest .raises (expected_exception = ResultGetError ):
8988 await backend .get_result (task_id = task_id )
9089
9190 await backend .shutdown ()
You can’t perform that action at this time.
0 commit comments