-
Notifications
You must be signed in to change notification settings - Fork 290
Raise custom error for FIFO delay instead of ArgumentError #957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis PR replaces the generic Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces the generic ArgumentError with a custom domain-specific FifoDelayNotSupportedError when attempting to use message delays with FIFO queues, which don't support per-message delays. This change aligns with the broader effort to introduce custom error types in the Shoryuken gem, making error handling more explicit and easier to rescue.
Changes:
- Added
FifoDelayNotSupportedErroras a new custom error class in theShoryuken::Errorsmodule - Updated the ActiveJob adapter to raise the new custom error instead of
ArgumentErrorwhen delays are used with FIFO queues - Updated test expectations to verify the new error type is raised
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/shoryuken/errors.rb | Defines the new FifoDelayNotSupportedError error class |
| lib/active_job/queue_adapters/shoryuken_adapter.rb | Updates error raising logic and documentation to use the new custom error |
| spec/shared_examples_for_active_job.rb | Updates test expectations to verify the new error type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #948
Replaces
ArgumentErrorwith a customFifoDelayNotSupportedErrorwhen attempting to use delay with FIFO queues.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.