Why "Actor finished successfully" when it actually ERRORed?
Why does Apify think this completed successfully when the log shows that it had an error?
3 Replies
adverse-sapphire•17mo ago
Hello @robertandrews,
the run status is by default not based on the number of successful/failed requests. The failed status is set, if the Actor throws an exception, by using the
Actor.fail
method or by setting specific exitCode in the method Actor.exit
.
Are you using your own Actor, or using some public one?harsh-harlequinOP•17mo ago
My own
Need to establish some kind of fail state when checking a run status via API (/actor-runs/) ... if it continued retrying and then finished because the selector was not on the page, I need to pick that up as a fail flag somehow, despite it otherwise being handled adequately by the script.
adverse-sapphire•17mo ago
I would suggest checking whether there are any output items after the crawler.run() method. In case there are not any, you can use any of the methods described above to change the run status to failed.