Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (42 sloc) 1.38 KB

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.

Jump to Line
Something went wrong with that request. Please try again.