aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/MessageParser.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-11-04 11:49:15 +0000
committerJon Skeet <jonskeet@google.com>2015-11-05 10:40:22 +0000
commit0fb39c4afee919eb7c2e5e6c5a254cb2ddcda724 (patch)
tree0b66d171c953994cb2289006fe54241bd81396fa /csharp/src/Google.Protobuf/MessageParser.cs
parentb6a32e909b1f58f157c19276af233e44627093f4 (diff)
downloadprotobuf-0fb39c4afee919eb7c2e5e6c5a254cb2ddcda724.tar.gz
protobuf-0fb39c4afee919eb7c2e5e6c5a254cb2ddcda724.tar.bz2
protobuf-0fb39c4afee919eb7c2e5e6c5a254cb2ddcda724.zip
Created a new exception for JSON failures.
This is only thrown directly by JsonTokenizer, but surfaces from JsonParser as well. I've added doc comments to hopefully make everything clear. The exception is actually thrown by the reader within JsonTokenizer, in anticipation of keeping track of the location within the document, but that change is not within this PR.
Diffstat (limited to 'csharp/src/Google.Protobuf/MessageParser.cs')
-rw-r--r--csharp/src/Google.Protobuf/MessageParser.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/MessageParser.cs b/csharp/src/Google.Protobuf/MessageParser.cs
index 70c52ba6..8f2717c5 100644
--- a/csharp/src/Google.Protobuf/MessageParser.cs
+++ b/csharp/src/Google.Protobuf/MessageParser.cs
@@ -148,6 +148,8 @@ namespace Google.Protobuf
/// </summary>
/// <param name="json">The JSON to parse.</param>
/// <returns>The parsed message.</returns>
+ /// <exception cref="InvalidJsonException">The JSON does not comply with RFC 7159</exception>
+ /// <exception cref="InvalidProtocolBufferException">The JSON does not represent a Protocol Buffers message correctly</exception>
public T ParseJson(string json)
{
T message = factory();