diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-11-05 08:57:57 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-11-05 08:57:57 -0800 |
commit | 25c045a1800c681443427379953e7380aa5eb6fe (patch) | |
tree | a4029a71092b9a82d070e2f43d3c8ec4e0e92b4c /csharp/src/Google.Protobuf/JsonParser.cs | |
parent | a030cc750ce26bbfa3e7f4fed3b24de19fba4127 (diff) | |
parent | 0fb39c4afee919eb7c2e5e6c5a254cb2ddcda724 (diff) | |
download | protobuf-25c045a1800c681443427379953e7380aa5eb6fe.tar.gz protobuf-25c045a1800c681443427379953e7380aa5eb6fe.tar.bz2 protobuf-25c045a1800c681443427379953e7380aa5eb6fe.zip |
Merge pull request #942 from jskeet/json-exception
Created a new exception for JSON failures.
Diffstat (limited to 'csharp/src/Google.Protobuf/JsonParser.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/JsonParser.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf/JsonParser.cs b/csharp/src/Google.Protobuf/JsonParser.cs index 6d2638d9..8da57745 100644 --- a/csharp/src/Google.Protobuf/JsonParser.cs +++ b/csharp/src/Google.Protobuf/JsonParser.cs @@ -337,6 +337,8 @@ namespace Google.Protobuf /// </summary> /// <typeparam name="T">The type of message to create.</typeparam> /// <param name="json">The JSON to parse.</param> + /// <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 Parse<T>(string json) where T : IMessage, new() { return Parse<T>(new StringReader(json)); @@ -347,6 +349,8 @@ namespace Google.Protobuf /// </summary> /// <typeparam name="T">The type of message to create.</typeparam> /// <param name="jsonReader">Reader providing the JSON to parse.</param> + /// <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 Parse<T>(TextReader jsonReader) where T : IMessage, new() { T message = new T(); |