Improved error handling for json patch documents.