From 7ea5cc2b36a4347290f49e7317971a6c72f19f25 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Mon, 1 Nov 2010 17:53:31 +0000 Subject: [PATCH] Added a new JsonSyntaxException to indicate syntax errors in Gson. --- .../com/google/gson/JsonSyntaxException.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 gson/src/main/java/com/google/gson/JsonSyntaxException.java diff --git a/gson/src/main/java/com/google/gson/JsonSyntaxException.java b/gson/src/main/java/com/google/gson/JsonSyntaxException.java new file mode 100644 index 00000000..47f1b14f --- /dev/null +++ b/gson/src/main/java/com/google/gson/JsonSyntaxException.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.gson; + +/** + * This exception is raised when Gson was unable to read an input stream + * or write to one. + * + * @author Inderjeet Singh + * @author Joel Leitch + */ +public final class JsonSyntaxException extends JsonParseException { + + public JsonSyntaxException(String msg) { + super(msg); + } + + public JsonSyntaxException(String msg, Throwable cause) { + super(msg, cause); + } + + /** + * Creates exception with the specified cause. Consider using + * {@link #JsonIOException(String, Throwable)} instead if you can describe what happened. + * + * @param cause root exception that caused this exception to be thrown. + */ + public JsonSyntaxException(Throwable cause) { + super(cause); + } +}