Closed asacalow closed 9 years ago
This is a bug - but should have a relatively striaghtforward fix.
Basically we just need to add a custom JSON serialiser for java exceptions to cheshire; our JSON parser/generator.
I'd suggest something along the lines of:
{:type :exception
:class "java.lang.NullPointerException"
:message "You broke stuff"
:stacktrace ["draft-management.clj drafter.rdf.draft-manangement/make-live:35" "flash.clj:35 ring.middleware.flash/wrap-flash[fn]"]
}
In some circumstances we may want to surface the stacktrace... e.g. when using the grafter import service... In others we probably don't want to...
@lkitching It would be :top: if you could :nut_and_bolt: this one together for me. It's on the async branch, and should be pretty simple. Ask mr @asacalow for details on how to recreate if you're unsure...
Basically Asa submits a request to add data to a draft... and then polls /status/:job-id till the task is done... Done tasks are ones that have their promise delivered, and the promise contains a datastructure which then contains the Exception, or a success message.
Failed jobs are still counted as finished jobs.
Asa wants the error back with a 200 response, but cheshire can't yet serialise java exceptions... so :boom: server 500!
Stacktrace below. Was expecting a 200 with a JSON body containing the error.