]>
iEval git - unical.git/blob - gson/com/google/gson/JsonParseException.java
2 * Copyright (C) 2008 Google Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com
.google
.gson
;
20 * This exception is raised if there is a serious issue that occurs during parsing of a Json
21 * string. One of the main usages for this class is for the Gson infrastructure. If the incoming
22 * Json is bad/malicious, an instance of this exception is raised.
24 * <p>This exception is a {@link RuntimeException} because it is exposed to the client. Using a
25 * {@link RuntimeException} avoids bad coding practices on the client side where they catch the
26 * exception and do nothing. It is often the case that you want to blow up if there is a parsing
27 * error (i.e. often clients do not know how to recover from a {@link JsonParseException}.</p>
29 * @author Inderjeet Singh
32 public class JsonParseException
extends RuntimeException
{
33 static final long serialVersionUID
= -4086729973971783390L;
36 * Creates exception with the specified message. If you are wrapping another exception, consider
37 * using {@link #JsonParseException(String, Throwable)} instead.
39 * @param msg error message describing a possible cause of this exception.
41 public JsonParseException(String msg
) {
46 * Creates exception with the specified message and cause.
48 * @param msg error message describing what happened.
49 * @param cause root exception that caused this exception to be thrown.
51 public JsonParseException(String msg
, Throwable cause
) {
56 * Creates exception with the specified cause. Consider using
57 * {@link #JsonParseException(String, Throwable)} instead if you can describe what happened.
59 * @param cause root exception that caused this exception to be thrown.
61 public JsonParseException(Throwable cause
) {
This page took 0.052263 seconds and 4 git commands to generate.