Skip to content

Commit

Permalink
Add color option
Browse files Browse the repository at this point in the history
  • Loading branch information
Uchio KONDO committed Nov 25, 2015
1 parent 31b8368 commit 05e7fc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/exception_notifier/slacky_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class SlackyNotifier
def initialize(options)
begin
webhook_url = options.fetch(:webhook_url)
@color = options.fetch(:color, :danger)
@message_opts = options.fetch(:additional_parameters, {})
@notifier = Slack::Notifier.new(webhook_url, options)
rescue
Expand Down Expand Up @@ -37,7 +38,7 @@ def valid?
def build_attachemnt(exception, options = {})
{
fallback: "#{exception.class} #{exception.message}",
color: "danger",
color: @color.to_s,
title: "[ERROR] #{exception.class}",
fields: [
{
Expand Down

0 comments on commit 05e7fc4

Please sign in to comment.