convert javascript exception to serializable rserve object, to start fixing #674