Initial discussion at kubernetes/kubernetes#97243 (comment). When callers call jsonpatch.MergePatch() func, it is better to let them know wether the doc or patch is invalid. Export the errBadJSONDoc and errBadJSONPatch to let callers take actions when such errors occur.