Skip to content

BabsLabs/errormoji

Repository files navigation

Errormoji

Build Status

Table of Contents

Example of Errormoji error messages:

  • (╯°□°)╯︵ ┻━┻ Something went wrong!
  • (ಥ_ಥ) File not found!
  • (ಠ益ಠ) Invalid input!

Supported Ruby & Rails Versions

  • Ruby: 3.0+
  • Rails: 7.0+

Installation

Add to your Gemfile:

bundle add errormoji

Or install directly:

gem install errormoji

Usage

Enabling & Disabling Emoji Decoration

Enable emoji decoration globally:

require "errormoji"
Errormoji.enable_global_exceptions!

Disable emoji decoration:

Errormoji.disable_global_exceptions!

Rails Integration

Enable or disable Errormoji per environment in your Rails config:

# config/environments/development.rb
Rails.application.config.errormoji.enabled = true

# config/environments/production.rb
Rails.application.config.errormoji.enabled = false

Legacy config is still supported:

Rails.application.config.errormoji_enabled = true

Note:

While Errormoji makes your errors way more fun (⌐■_■), we don’t recommend enabling it in production—unless your ops team loves errormojis as much as you do! Decorated error messages might confuse your logs, monitoring tools, or that one serious developer on your team. But hey, you’re the boss: enable Errormoji wherever you want!


Customization

Set your own emojis:

Errormoji.emojis = ["😄", "😢", "😡"]

Add emojis to your current list:

Errormoji.emojis << "🤖"
Errormoji.emojis += ["🔥"]

Build your emoji set incrementally!


Development

After checking out the repo, run:

bin/setup

Use bin/console for an interactive prompt.


Running Tests

Run the test suite with:

bundle exec rake test

Enable verbose Rails request logging for dummy-app integration tests only when needed:

bundle exec rake test:verbose

You can still use the environment variable directly if preferred:

ERRORMOJI_VERBOSE_TEST_LOGS=true bundle exec rake test

Rails integration coverage is split into two focused files:

  • test/integration/railtie_test.rb validates Railtie config behavior.
  • test/integration/railtie_exceptions_test.rb validates real Rails-raised exceptions from a minimal dummy app are decorated when enabled and plain when disabled.

The Rails exception integration tests boot a minimal app from test/dummy/ and exercise representative Rails exception scenarios through both raised-exception and middleware-rescued request paths.


Roadmap

  • CI currently validates Rails integration against one Rails stream (latest resolvable Rails with Ruby 3.4); expand this to a Rails-version matrix.
  • Add configurable severity levels (for example, map warn/error/fatal to different emoji sets).
  • Support patching only specific exception classes instead of patching globally.

Releasing a New Version

Errormoji uses Semantic Versioning.

To release a new version:

  1. Update the version number in lib/errormoji/version.rb.
  2. Run:
    bundle exec rake release
    This will tag, push, and publish the gem to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub. Please follow our Code of Conduct.


License

Open source under the MIT License.


Thank You for Using Errormoji!

We appreciate you bringing a little more fun to your error messages. Happy coding!

(╯°□°)╯︵ ┻━┻

About

Errormoji — A Ruby gem that decorates error messages with ASCII emojis for more fun and expressive debugging. Works standalone or with Rails. Flip the table on boring errors! (╯°□°)╯︵ ┻━┻

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors