Skip to content

Commit 0364003

Browse files
committed
fix actor exit code
1 parent dfc02e3 commit 0364003

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/apify/_actor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,13 @@ 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-
222219
self._raise_if_not_initialized()
223220

224221
if exc_value and not is_running_in_ipython():
225222
# In IPython, we don't run `sys.exit()` during Actor exits,
226223
# so the exception traceback will be printed on its own
227224
self.log.exception('Actor failed with an exception', exc_info=exc_value)
228-
self.exit_value = ActorExitCodes.ERROR_USER_FUNCTION_THREW.value
225+
self.exit_code = ActorExitCodes.ERROR_USER_FUNCTION_THREW.value
229226

230227
self._is_exiting = True
231228
self.log.info('Exiting Actor', extra={'exit_code': self.exit_code})

0 commit comments

Comments
 (0)