chore: utilize ensure_context decorator for Actor#400
Conversation
janbuchar
left a comment
There was a problem hiding this comment.
I'm honestly not sure about this. It reduces some duplication, yes, but the error message will be pretty cryptic. It is fine for an internal helper in Crawlee, but here, it's very much user-facing. Maybe we could make a wrapper for the decorator?
|
Error message: Whole traceback: Is it that bad? We can wrap it of course. |
Well, leaking the existence of |
Pijukatel
left a comment
There was a problem hiding this comment.
I like this decorator, maybe we have to have custom error message in this case, but I think it makes the code more readable.
|
Yep, I will try to update the decorator to have a better error message there. |
janbuchar
left a comment
There was a problem hiding this comment.
Please wrap that error message 🙂
|
Clousing, since we moved the flag(s) to the class level, and I'm afraid this means we can't utilize |
|
Superseded by #822 |
Utilize
ensure_contextdecorator from Crawlee rather than callingraise_if_...method in the Actor class.