CMIS-985: fixed AtomPub error handling
git-svn-id: https://svn.apache.org/repos/asf/chemistry/portcmis/trunk@1751223 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/PortCMIS/binding/atompub/AtomPubBinding.cs b/PortCMIS/binding/atompub/AtomPubBinding.cs
index 5ccf7e6..c812773 100644
--- a/PortCMIS/binding/atompub/AtomPubBinding.cs
+++ b/PortCMIS/binding/atompub/AtomPubBinding.cs
@@ -621,7 +621,8 @@
return null;
}
- return errorContent.Substring(begin + "<!--exception-->".Length, end);
+ int textStart = begin + "<!--exception-->".Length;
+ return errorContent.Substring(textStart, end - textStart);
}
protected string ExtractErrorMessage(string message, string errorContent)
@@ -639,7 +640,8 @@
return message;
}
- return errorContent.Substring(begin + "<!--message-->".Length, end);
+ int textStart = begin + "<!--message-->".Length;
+ return errorContent.Substring(textStart, end - textStart);
}
// ---- helpers ----