Save last_error on init and emit - #29
Conversation
There was a problem hiding this comment.
whoops, I'll resubmit in a sec without this change
|
@kiyoto - I just wanted to follow up on our earlier email discussion. Do you think this PR can be merged? |
|
🔔 - Any update on this? |
|
@yyuu and @kiyoto - The existing tests also fail in that case, but because error information was discarded, the failure was not detectable. I added comments to indicate this where appropriate to existing tests. I believe that this is therefore an important fix. In my opinion, it makes sense to take this increment of value right away. We can update all tests to work properly without a running fluentd instance in another PR. |
|
Hiding the connect or send error is crazy, this library needs to be fixed. Look how the ruby library returns a success or failure by bubbling up a true or false on the post() method here: This lib should ideally do the same, beside storing the error, a new event should have a post() method and that should return a true/false on success or not. That makes usage far more clear IMO. |
This patch is based on cabiad's patch. #29
|
I merged #59. |
Uses a threadlocal variable to store errors, which a user of this library can optionally access and act on after initializing the sender (initially connecting to the fluentd server) or emitting an event.
Also includes relevant tests.