Skip to content

Instantly share code, notes, and snippets.

@npepinpe
Created July 29, 2016 12:19
Show Gist options
  • Save npepinpe/1f242dfff8c55d6c6c5bd4da0fddd601 to your computer and use it in GitHub Desktop.
Save npepinpe/1f242dfff8c55d6c6c5bd4da0fddd601 to your computer and use it in GitHub Desktop.
def context(context)
previous_context = self.get_context
Thread.current[:__honeybadger_context] = previous_context.respond_to?(:merge) ? previous_context.merge(context) : context
yield
ensure
Thread.current[:__honeybadger_context] = previous_context
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment