Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ActiveError

Gem Version Build Status

Easily create an exception with backtrace.

Usage

ActiveError.new(StandardError, "error message")
ActiveError.new(StandardError, "error message", backtrace: caller)

# default error class is StandardError
ActiveError.new("error message")
ActiveError.new("error message", backtrace: caller)

Why

Fix this common pattern:

exception = StandardError.new("error message")
exception.set_backtrace(caller)

Should be in one-step:

ActiveError.new(StandardError, "error message", backtrace: caller)

Enjoy 🎉

Installation

Add this line to your application's Gemfile:

gem "active_error"

And then execute:

$ bundle

Or install it yourself as:

$ gem install active_error

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/JuanitoFatas/active_error.

License

The gem is available as open source under the terms of the Apache License 2.0.

About

Create an exception with backtrace has never been easier ❤️

Resources

License

Packages

No packages published

Languages