Skip to content

Instantly share code, notes, and snippets.

@starrhorne
starrhorne / gist:5824347
Created June 20, 2013 16:35
How to send an error to HB manually
begin
raise "some error"
rescue => e
# Use one of the two methods below. Not both :)
# Use this to ALWAYS send the error to honeybadger regardless of error class
Hoenybadger.notify(e)
# This will only send the error if it doesn't match any of the exclusion rules
@starrhorne
starrhorne / honeybadger.rb
Created June 21, 2013 15:32
Sample honeybadger initializer for heroku
Honeybadger.configure do |config|
config.api_key = ENV['HONEYBADGER_API_KEY']
end
@starrhorne
starrhorne / test.bash
Created June 21, 2013 15:46
This is how you generate a test exception from your local computer, when you're using the heroku addon. Be sure to replace the api key below with your real API key, as found on the project settings page :)
rake honeybadger:test HONEYBADGER_API_KEY=12345
@starrhorne
starrhorne / a.rb
Created September 8, 2013 18:04
Sample
a=1
" begin script to prevent pase over from replacing the default register
" contents
function! RestoreRegister()
let @" = s:restore_reg
return ''
endfunction
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
@starrhorne
starrhorne / main.rs
Created July 6, 2017 22:03
The `use errors::*` in mymodule causes an unused import warning
#![recursion_limit = "1024"]
#[macro_use]
extern crate error_chain;
mod errors {
error_chain!{}
}
use errors::*;