Marshalling failure_errors to preserve constants when be converted to JSON