Replace payload with exception message #49

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@cfurrow
cfurrow commented Oct 2, 2013

When Psych fails to parse the YAML, it should show the exception message as the payload, and not fail to retrieve any results.

Problem: When a delayed job has a deserialization error (bad YAML, or something), dj_mon fails to retrieve any results part of that 'batch' and instead returns an HTTP 500 error message to the AJAX request. Making one have to dig through logs to see what is going on.

Fix: Capture deserialization errors in dj_mon's DjReport, and output the exception and message as the job's payload so that it can be displayed in the dj_mon UI

Screengrab:
image

@cfurrow
cfurrow commented Oct 2, 2013

@akshayrawat I was originally going to just rescue Psych::SyntaxError but then decided against that because what if the ruby version wasn't using Psych to parse YAML? And, at this time, Psych::SyntaxError does not inherit from StandardError, but instead inherits from SyntaxError.

Do you think I should change it back to capturing Psych::SyntaxError if Psych is defined?

@cfurrow cfurrow Replace payload with exception message
Handle SyntaxError and StandardError, and output $!.message as payload
6874168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment