***  This class is subject to change.  ***

com.sas.iquery
Class IQueryServicesException

com.sas.iquery.IQueryServicesException
All Implemented Interfaces:
com.sas.util.LocalizableToStringInterface, java.io.Serializable
Direct Known Subclasses:
DataServicesException, com.sas.iquery.intelligentquery.IntelligentQueryException, IQueryException, SASFormatException

public class IQueryServicesException
implements com.sas.util.LocalizableToStringInterface

Originally based on LocalizableException.

Since:
SAS v920
See Also:
Serialized Form

Constructor Summary
IQueryServicesException(java.lang.String message)
          Create an IQueryServicesException with a (non localized) message.
IQueryServicesException(java.lang.String message, java.lang.Throwable cause)
          Create an IQueryServicesException with a (non localized) message and a cause.
 
Method Summary
 Reason getFirstReason()
          Deprecated. deprecated in 9.3, to be removed in 9.4. Providing a getFirstReason() method is inappropriate to this API. If the caller desires to get the first reason, this should be done in the caller code, as in:
 IQueryServericsException e = x ; // some IQ exception
 Reason reason = null;
 if ( !e.getReasons().isEmpty()) {
    reason = e.getReason(1); // get first reason
 } 
 if (reason != null) {
    // do something with reason
 }
 
This can be shortened as follows:
 IQueryServericsException e = x ; // some IQ exception
 Reason reason = (!e.getReasons().empty ? e.getReasons.get(0) : null);
 
 java.util.List<Reason> getReasons()
          Returns the List of Reason objects associated with this exception.
 java.lang.String getSASLog()
          get the SAS log specifically set for this exception.
 java.lang.String getSASLog(boolean searchCauses, boolean combineLogs)
          Returns the SAS Log for this exception (if one available).
 boolean hasReasonWithCodes(int reasonCode, int subreasonCode)
          Returns whether any Reason object set on this exception contains the given reason/subreason pair of values.
 

Constructor Detail

IQueryServicesException

public IQueryServicesException(java.lang.String message)
Create an IQueryServicesException with a (non localized) message.

It is generally better to create an IQueryServicesException with a localized message, using the constructor IQueryServicesException(MessageFormatter message).

Parameters:
message - the (non localized) message
See Also:
IQueryServicesException(MessageFormatter message)

IQueryServicesException

public IQueryServicesException(java.lang.String message,
                               java.lang.Throwable cause)
Create an IQueryServicesException with a (non localized) message and a cause.

It is generally better to create an IQueryServicesException with a localized message, using the constructor IQueryServicesException(String message, Throwable cause).

Parameters:
message - the (non localized) message
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). A null value is permitted and indicates that the cause is nonexistent or unknown.
See Also:
IQueryServicesException(MessageFormatter message)
Method Detail

getReasons

public java.util.List<Reason> getReasons()
Returns the List of Reason objects associated with this exception. Returns an empty list if no reasons are associated with this exception.

Returns:
a List of Reason objects associated with this exception. The list may be empty, but never null.

getFirstReason

@Deprecated
public Reason getFirstReason()
Deprecated. deprecated in 9.3, to be removed in 9.4. Providing a getFirstReason() method is inappropriate to this API. If the caller desires to get the first reason, this should be done in the caller code, as in:
 IQueryServericsException e = x ; // some IQ exception
 Reason reason = null;
 if ( !e.getReasons().isEmpty()) {
    reason = e.getReason(1); // get first reason
 } 
 if (reason != null) {
    // do something with reason
 }
 
This can be shortened as follows:
 IQueryServericsException e = x ; // some IQ exception
 Reason reason = (!e.getReasons().empty ? e.getReasons.get(0) : null);
 

Returns the first Reason associated with this exception or null if no reason is associated with this exception.

Returns:
the first Reason object associated with this exception or null if none exist.

hasReasonWithCodes

public boolean hasReasonWithCodes(int reasonCode,
                                  int subreasonCode)
Returns whether any Reason object set on this exception contains the given reason/subreason pair of values.

Parameters:
reasonCode - The integer value of reason.
subreasonCode - The integer value of subreason.
Returns:
Whether any Reason object set on this exception contains the given reason/subreason pair of values.

getSASLog

public java.lang.String getSASLog()
get the SAS log specifically set for this exception.

Returns:
SAS Log

getSASLog

public java.lang.String getSASLog(boolean searchCauses,
                                  boolean combineLogs)
Returns the SAS Log for this exception (if one available). If searchCauses is true then it will return the SAS Log found on the deepest chained/causing exception related to this one. If combineLogs is true and searchCauses is true then all of the logs from the exception chain are combined into one string.

Parameters:
searchCauses - will search any causing/chained exceptions and return the deepest log, will only return the top value
combineLogs - will combine all logs found when searching causes, will return only one log (top or bottom depending upon searchCauses)
Returns:

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.