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

Handle MissingConverterException errors #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robbavey
Copy link
Contributor

@robbavey robbavey commented Dec 6, 2019

With certain JMS providers, the JMS headers may include values that
cannot be handled and added to an event, which currently throw either
a MissingConverterException or an IllegalArgumentException. This commit
attempts to handle these errors more gracefully by calling to_s and
attempting to use the string representation rather than crash the plugin

With certain JMS providers, the JMS headers may include values that
cannot be handled and added to an event, which currently throw either
a MissingConverterException or an IllegalArgumentException. This commit
attempts to handle these errors more gracefully by calling `to_s` and
attempting to use the string representation rather than crash the plugin
Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

[edit] added a nitpick to avoid relying on the #inspect for logging an exception which can give us unhelpful information

# And IllegalArgumentException, which are used across different
# Logstash versions for Valuefier errors
logger.warn("Unable to convert value of type #{value.class} for field #{field}, falling back to using string representation",
:exception => e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:exception => e)
:exception => e.class, :message => e.message)

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