dj_mon icon indicating copy to clipboard operation
dj_mon copied to clipboard

Replace payload with exception message

Open cfurrow opened this issue 11 years ago • 1 comments

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 avatar Oct 02 '13 20:10 cfurrow

@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 avatar Oct 02 '13 21:10 cfurrow