diff options
author | Jie Luo <anandolee@gmail.com> | 2016-05-11 16:07:43 -0700 |
---|---|---|
committer | Jie Luo <anandolee@gmail.com> | 2016-05-11 16:07:43 -0700 |
commit | e1f588ae3c5efc7e297e1cb76d42f46d0d4eb3ca (patch) | |
tree | 903944637fd62784dfc1c844eb5af96bdffe9863 /csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs | |
parent | c61207492efa36244ffa16cc5b394e71888e4c0f (diff) | |
parent | 71dd9c4a5ed5c0fb3eff12cddd17116432db9faf (diff) | |
download | protobuf-e1f588ae3c5efc7e297e1cb76d42f46d0d4eb3ca.tar.gz protobuf-e1f588ae3c5efc7e297e1cb76d42f46d0d4eb3ca.tar.bz2 protobuf-e1f588ae3c5efc7e297e1cb76d42f46d0d4eb3ca.zip |
Merge pull request #1 from google/beta-3
Beta 3
Diffstat (limited to 'csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs index 01d55395..eeb0f13a 100644 --- a/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs +++ b/csharp/src/Google.Protobuf/InvalidProtocolBufferException.cs @@ -30,6 +30,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
+using System;
using System.IO;
namespace Google.Protobuf
@@ -45,6 +46,11 @@ namespace Google.Protobuf {
}
+ internal InvalidProtocolBufferException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
internal static InvalidProtocolBufferException MoreDataAvailable()
{
return new InvalidProtocolBufferException(
@@ -82,6 +88,11 @@ namespace Google.Protobuf "Protocol message contained an invalid tag (zero).");
}
+ internal static InvalidProtocolBufferException InvalidBase64(Exception innerException)
+ {
+ return new InvalidProtocolBufferException("Invalid base64 data", innerException);
+ }
+
internal static InvalidProtocolBufferException InvalidEndTag()
{
return new InvalidProtocolBufferException(
@@ -95,6 +106,13 @@ namespace Google.Protobuf "Use CodedInputStream.SetRecursionLimit() to increase the depth limit.");
}
+ internal static InvalidProtocolBufferException JsonRecursionLimitExceeded()
+ {
+ return new InvalidProtocolBufferException(
+ "Protocol message had too many levels of nesting. May be malicious. " +
+ "Use JsonParser.Settings to increase the depth limit.");
+ }
+
internal static InvalidProtocolBufferException SizeLimitExceeded()
{
return new InvalidProtocolBufferException(
|