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
@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?
Replace payload with exception message
Handle SyntaxError and StandardError, and output $!.message as payload