simple_segment icon indicating copy to clipboard operation
simple_segment copied to clipboard

`on_error` is inconsistent with `analytics-ruby`

Open ojab opened this issue 4 years ago • 2 comments

analiytics-ruby passes two arguments, while simple_segment passes four, so on_error: ->(status, message) {} doesn't work.

ojab avatar Dec 17 '20 14:12 ojab

Hey @ojab, thanks for submitting this! You are correct, this is not backwards-compatible with analytics-ruby. I still feel reluctant about changing the signature to 2 arguments, since at this point this would be a breaking change for this gem 🤔

I'll leave this issue open and might change to a 2-argument on_error in a future 2.x release.

whatthewhat avatar Dec 22 '20 10:12 whatthewhat

Sure, it's probably easier to change it to 4 argument in analytics-ruby with backward-compatible way. I'm planning to finish some backlog on NY holidays and make/submit some PRs, I'll try to include this. And if it would be NAKed — we could do this in backward-compatible way in simple_segment by checking error_handler.arity.

ojab avatar Dec 22 '20 10:12 ojab