- add exception class in debug mode

- emit exceptions on config compile errors.
This commit is contained in:
Jordan Sissel 2013-08-20 22:55:32 -07:00
parent 8b34a61cd3
commit 6cde55106b
2 changed files with 9 additions and 2 deletions

View file

@ -22,7 +22,12 @@ class LogStash::Pipeline
# The config code is hard to represent as a log message...
# So just print it.
@logger.debug? && @logger.debug("Compiled pipeline code:\n#{code}")
eval(code)
begin
eval(code)
rescue => e
p e.backtrace[1]
raise
end
@input_to_filter = SizedQueue.new(20)
@ -149,7 +154,8 @@ class LogStash::Pipeline
rescue => e
if @logger.debug?
@logger.error(I18n.t("logstash.pipeline.worker-error-debug",
:plugin => plugin.inspect, :error => e,
:plugin => plugin.inspect, :error => e.to_s,
:exception => e.class,
:stacktrace => e.backtrace.join("\n")))
else
@logger.error(I18n.t("logstash.pipeline.worker-error",

View file

@ -26,6 +26,7 @@ en:
A plugin had an unrecoverable error. Will restart this plugin.
Plugin: %{plugin}
Error: %{error}
Exception: %{exception}
Stack: %{stacktrace}
plugin-loading-error: >-
Couldn't find any %{type} plugin named '%{name}'. Are you