File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,9 @@ async def __aexit__(
216216 if self ._is_exiting :
217217 return
218218
219+ if exc_value :
220+ self .exit_code = ActorExitCodes .ERROR_USER_FUNCTION_THREW .value
221+
219222 self ._raise_if_not_initialized ()
220223
221224 if exc_value and not is_running_in_ipython ():
Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING
44
5+ from apify_shared .consts import ActorExitCodes
6+
57from apify import Actor
68
79if TYPE_CHECKING :
@@ -115,7 +117,7 @@ async def main() -> None:
115117 actor = await make_actor (label = 'with-actor-fail' , main_func = main )
116118 run_result = await run_actor (actor )
117119
118- assert run_result .exit_code == 91
120+ assert run_result .exit_code == ActorExitCodes . ERROR_USER_FUNCTION_THREW . value
119121 assert run_result .status == 'FAILED'
120122
121123
You can’t perform that action at this time.
0 commit comments