Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error interpolation on malformed requests #3

Merged
merged 1 commit into from
Aug 10, 2015
Merged

Conversation

spang
Copy link
Contributor

@spang spang commented Jun 17, 2015

Fixes traces like this, if you, say, omit the '#' in your channel name:

root@f986c8becbda:~# /opt/logstash/bin/logstash -e '
input { stdin {} }
output { slack { username => "loggy" icon_emoji => ":evergreen_tree:"
format => "%{message}" channel => "signups" url =>
"your-slack-URL"
} }'
slack plugin is using the 'milestone' method to declare the version of
the plugin this method is deprecated in favor of declaring the version
inside the gemspec. {:level=>:warn}
Logstash startup completed
Testing testing 1 2 3
Unhandled exception {:exception=>#<TypeError: can't convert
Net::HTTPInternalServerError into String>,
:stacktrace=>["org/jruby/RubyString.java:1157:in +'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-slack-0.1.0/lib/logstash/outputs/slack.rb:69:in receive'", "org/jruby/RubyProc.java:271:in call'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in process_result'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in
transmit'", "/opt/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:746:in start'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in
transmit'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in execute'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in
execute'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient.rb:69:in post'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-slack-0.1.0/lib/logstash/outputs/slack.rb:64:in
receive'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/outputs/base.rb:88:in handle'", "(eval):22:in output_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:244:in outputworker'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:166:in
`start_outputs'"], :level=>:warn}

Fixes traces like this, if you, say, omit the '#' in your channel name:

root@f986c8becbda:~# /opt/logstash/bin/logstash -e '
input { stdin {} }
output { slack { username => "loggy" icon_emoji => ":evergreen_tree:"
format => "%{message}" channel => "signups" url =>
"your-slack-URL"
} }'
slack plugin is using the 'milestone' method to declare the version of
the plugin this method is deprecated in favor of declaring the version
inside the gemspec. {:level=>:warn}
Logstash startup completed
Testing testing 1 2 3
Unhandled exception {:exception=>#<TypeError: can't convert
Net::HTTPInternalServerError into String>,
:stacktrace=>["org/jruby/RubyString.java:1157:in `+'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-slack-0.1.0/lib/logstash/outputs/slack.rb:69:in
`receive'", "org/jruby/RubyProc.java:271:in `call'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in
`process_result'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in
`transmit'", "/opt/logstash/vendor/jruby/lib/ruby/1.9/net/http.rb:746:in
`start'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in
`transmit'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in
`execute'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in
`execute'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/rest-client-1.8.0/lib/restclient.rb:69:in
`post'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-slack-0.1.0/lib/logstash/outputs/slack.rb:64:in
`receive'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/outputs/base.rb:88:in
`handle'", "(eval):22:in `output_func'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:244:in
`outputworker'",
"/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:166:in
`start_outputs'"], :level=>:warn}
@cyli
Copy link
Owner

cyli commented Aug 10, 2015

Oops, I'm sorry, I'm not sure why I missed this PR. This is great, thank you for your contribution!

cyli added a commit that referenced this pull request Aug 10, 2015
Fix error interpolation on malformed requests
@cyli cyli merged commit d582e4e into cyli:master Aug 10, 2015
@cyli cyli mentioned this pull request Aug 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants