0.0
No commit activity in last 3 years
No release in over 3 years
raise exceptions, with emotion and intensity
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
>= 0
~> 5.0
~> 10.0
 Project Readme

AngryRaise

Build Status

raise exceptions, with emotion and intensity

Usage

require "angry_raise"

raise! "an error occured"                   # "RuntimeError: an error occured!"
raise! SomeError, "an error occured"        # "SomeError: an error occured!"
raise! SomeError.new("an error occured")    # "SomeError: an error occured!"

raise!! "an error occured"                  # "RuntimeError: An error occured!!"
raise!! SomeError, "an error occured"       # "SomeError: An error occured!!"
raise!! SomeError.new("an error occured")   # "SomeError: An error occured!!"

raise!!! "an error occured"                 # "RuntimeError: An Error Occured!!!"
raise!!! SomeError, "an error occured"      # "SomeError: An Error Occured!!!"
raise!!! SomeError.new("an error occured")  # "SomeError: An Error Occured!!!"

raise!!!! "an error occured"                # "RuntimeError: AN ERROR OCCURED!!!!"
raise!!!! SomeError, "an error occured"     # "SomeError: AN ERROR OCCURED!!!!"
raise!!!! SomeError.new("an error occured") # "SomeError: AN ERROR OCCURED!!!!"

Feel free to capture the mood of each caller:

raise!!!!!!!!!!!!!! "an error occured"  # RuntimeError: AN ERROR OCCURED!!!!!!!!!!!!!!

You can add a backtrace too, because sometimes, it's appropriate:

raise!!! SomeError, "an error occured", %w[frame1 frame2 frame3]

Internationalization

I18n.locale = :es
raise!!! "tenemos un problema aqui"  # ¡¡¡Tenemos Un Problema Aqui!!!

Currently only supports Spanish. Is there any other language to support?

Can I Use This in Production?

Should one ever use monkey patched code in production‽‽‽

This library changes the behavior or String#!, Exception#! and Exception::! to the exact opposite of their default implementations! So, I'd say NO!!!!

Author

Skye Shaw [skye.shaw =AT= gmail]

See Also

  • Acme::Crap - The Perl module that served as inspiration
  • Table flipper - Prepends the table flipper on Exception messages
  • class2 - DSL for creating class hierarchies
  • YYMMDD - Tiny DSL for idiomatic date parsing and formatting