Convert the exception object to a jsonable object before postMessage