Simplified exceptions catcher
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
test
.gitignore
.travis.yml
.yardopts
Gemfile
MIT-LICENSE
README.md
Rakefile
exceptioncatchable.gemspec

README.md

exceptioncatchable

Build Status Gem Version

Description

Simplified exceptions catcher

Features

  • #catch_exception: catch targeted exceptions
  • #rescue_exception: catch_exception + sub-exceptions
  • Pure Ruby :)

Usage

include ExceptionCatchable

p catch_exception(SyntaxError){raise SyntaxError} #=> #<SyntaxError: ...>
p rescue_exception(Exception){raise SyntaxError}  #=> #<SyntaxError: ...>
p rescue_exception{raise SyntaxError}             #=> #<SyntaxError: ...>

And see test-case

Requirements

Install

$ gem install exceptioncatchable

Link

License

The MIT X11 License
Copyright (c) 2012 Kenichi Kamiya
See MIT-LICENSE for further details.