netapp.manage
Class NaAPIFailedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bynetapp.manage.NaException
              extended bynetapp.manage.NaAPIFailedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NaProxyFailedException

public class NaAPIFailedException
extends NaException

Thrown to indicate that the API invocation failed. The server processed the request and returned a failure result including an errno code and a reason string.

See Also:
Serialized Form

Constructor Summary
NaAPIFailedException(int errno, java.lang.String reason)
          Constructs a new NaAPIFailedException with the specified errno and reason message.
 
Method Summary
 int getErrno()
          Return the errno value from an API result.
 java.lang.String getReason()
          Return the reason for the API failure.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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

NaAPIFailedException

public NaAPIFailedException(int errno,
                            java.lang.String reason)
Constructs a new NaAPIFailedException with the specified errno and reason message.

Parameters:
errno - the error number.
reason - the reason message.
Method Detail

getErrno

public int getErrno()
Return the errno value from an API result. See the NaErrno class which contains defined constants for the possible errno values. In some cases, the server does not return an errno code (due to a bug) and this function returns NaErrno.EINTERNALERROR as a default.

Returns:
The errno value.

getReason

public java.lang.String getReason()
Return the reason for the API failure.

Returns:
The message which describes the reason for a failure.