Code example for JsonSyntaxException

Methods: printStackTrace

0
			ErrorMessage e = gson.fromJson(json, ErrorMessage.class);
			if ( e== null || e.getError() == null ) return false;
			return true; 
		} 
		catch (JsonSyntaxException e) {
			e.printStackTrace();
			return false; 
		} 
	} 
	 
	public static ErrorMessage parseError( String json ) {
		Gson gson = new Gson();
		ErrorMessage e = gson.fromJson(json, ErrorMessage.class);
		return e;
	} 
	 
	public static ResponseMessage parseResponse( String json ) {
		Gson gson = new Gson();
		ResponseMessage m = gson.fromJson(json, ResponseMessage.class);
		return m;
Contextual code suggestions in your IDE  Get Codota for Java