com.google.visualization.datasource.base
Class DataSourceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.google.visualization.datasource.base.DataSourceException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CsvDataSourceException, InvalidQueryException, TypeMismatchException

public class DataSourceException
extends java.lang.Exception

An exception to be used by callers and callees of the library. Each exception has a type taken from ReasonType, and a message that can be used to output an appropriate message to the user. Example: new DataSourceException(ReasonType.InvalidQuery, "The query cannot be empty")

Author:
Hillel M.
See Also:
Serialized Form

Constructor Summary
DataSourceException(ReasonType reasonType, java.lang.String messageToUser)
          Constructs a new exception with a single message for the user.
 
Method Summary
 java.lang.String getMessage()
          Deprecated. 
 java.lang.String getMessageToUser()
          Returns the message for the user.
 ReasonType getReasonType()
          Returns the reason type of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceException

public DataSourceException(ReasonType reasonType,
                           java.lang.String messageToUser)
Constructs a new exception with a single message for the user.

Parameters:
reasonType - The reason type of the exception.
messageToUser - The message for the user.
Method Detail

getMessageToUser

public java.lang.String getMessageToUser()
Returns the message for the user.

Returns:
The message for the user.

getReasonType

public ReasonType getReasonType()
Returns the reason type of this exception.

Returns:
The reason type of this exception.

getMessage

@Deprecated
public java.lang.String getMessage()
Deprecated. 

Overrides:
getMessage in class java.lang.Throwable


Copyright © 2009 Google. All Rights Reserved.