You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to log unpredictable responses and indicate my feed id in the log message.
Is there any way to pass the context inside the middleware?
As I see there is no any way to access Spider or Spider->context from ResponseMiddlewareInterface, or from Request/Response objects…
P.s.
So far, the only way I have found to solve this problem is to make a custom Overrides object with a full set of middlewares and pass the feed id when creating this object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I want to log unpredictable responses and indicate my
feed id
in the log message.Is there any way to pass the context inside the middleware?
As I see there is no any way to access
Spider
orSpider->context
fromResponseMiddlewareInterface
, or fromRequest
/Response
objects…P.s.
So far, the only way I have found to solve this problem is to make a custom
Overrides
object with a full set of middlewares and pass thefeed id
when creating this object.Like so:
But it looks ugly, or I need to make factory.
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions