Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
active_job_exception_handler
Advanced tools
For a secure install, type the following (recommended):
gem cert --add <(curl --location --silent /gem-public.pem)
gem install active_job_exception_handler --trust-policy MediumSecurity
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
For an insecure install, type the following (not recommended):
gem install active_job_exception_handler
Add the following to your Gemfile:
gem "active_job_exception_handler"
Initialize it like this:
class ApplicationJob < ActiveJob::Base
before_perform :initialize_exception_handler
def perform(normal:, credentials: {}, spawn_job_id:, exception_handler: default_exception_handler)
@exception_handler = exception_handler
initialize_exception_handling
exception_handler.process! do
return if skip?
collector.run run_options
emitter.flush!
kapost_client.update_credentials(adapter.updated_tokens) if adapter.refreshed_tokens?
perform_successful
end
end
protected
def exception_handler
@exception_handler ||= ExceptionHandler.new(exception_context: exception_context)
end
def exception_context
ExceptionContext.new(
source: self.class.name,
queue: queue_name,
args: arguments
)
end
def initialize_exception_handling
# implement this method to define how errors are handled
end
end
And then use it in jobs like this:
class MyJob < ApplicationJob
def perform(...)
# ...
end
protected
def initialize_exception_handling
exception_handler.add HTTPServerError, :retryables # Transient HTTP error
exception_handler.add HTTPAuthenticationError, :unretryables # User credentials are wrong, don't retry
exception_handler.add HTTPNotFoundError, :ignorables # Page is gone, we don't care anymore
end
end
To test, run:
bundle exec rake
Read Semantic Versioning for details. Briefly, it means:
Please note that this project is released with a CODE OF CONDUCT. By participating in this project you agree to abide by its terms.
Read CONTRIBUTING for details.
Copyright (c) 2017 . Read LICENSE for details.
Read CHANGES for details. Built with Gemsmith.
Developed by Paul Sadauskas and Brooke Kuhlmann at Kapost.
FAQs
Unknown package
We found that active_job_exception_handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.