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.