oracle.kv

## Class FaultException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - oracle.kv.FaultException

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    ConsistencyException, DurabilityException, KVSecurityException, PartialLOBException, RequestLimitException, RequestTimeoutException, SchemaNotAllowedException, UndefinedSchemaException

      public class FaultException
      extends RuntimeException

  Used to indicate an error condition that cannot normally be handled by the caller of the method, except by retrying the operation.

  When the error occurred remotely and was due to an internally defined server exception, the `Throwable.getCause()` method will return null rather than returning the internal exception, and the remote stack trace will not be a part of the stack trace of this exception. This is because the internal exception class is not present in the client library.

  For logging, testing and debugging purposes, the full textual stack trace of the remote exception, including any nested cause exceptions, is available using the `getRemoteStackTrace()` method, and the remote (or local) exception's class name is returned by `getFaultClassName()`. The `toString()` and `Throwable.printStackTrace()` methods output the fault class name and remote stack trace.

  When the error occurred remotely, it will have already been logged and reported on a remote KVStore node and will be available to administrators. However, to correlate client and server errors and to make error information easily accessible on the client, it is good practice to also log the error locally. Errors that originated locally are not automatically logged and available to administrators, and the client application is responsible for reporting them. See `wasLoggedRemotely()`.

  See Also:
    Serialized Form

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getFaultClassName()` Returns the name of the class associated with the original fault exception, or the name of the local exception class if the error occurred locally.
    `String` | `getRemoteStackTrace()` Returns the textual stack trace associated with the remote fault exception, or null if the error occurred locally.
    `String` | `toString()` Returns a description of the fault that includes the standard `Throwable` description (class name and message), followed by the fault class name, followed by the remote stack trace (if any).
    `boolean` | `wasLoggedRemotely()` Returns whether the exception was previously logged remotely.

    - ### Methods inherited from class java.lang.Throwable

      `fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### wasLoggedRemotely

          public boolean wasLoggedRemotely()

      Returns whether the exception was previously logged remotely.

      When the error occurred remotely, it will have already been logged and reported on a remote KVStore node and will be available to administrators. However, to correlate client and server errors and to make error information easily accessible on the client, it is good practice to also log the error locally. Errors that originated locally are not automatically logged and available to administrators, and the client application is responsible for reporting them.

    - #### getFaultClassName

          public String getFaultClassName()

      Returns the name of the class associated with the original fault exception, or the name of the local exception class if the error occurred locally. When the error occurred locally and this exception is a simple wrapper, the class name of the wrapped exception is returned. This method exists primarily for logging, testing and debugging.

    - #### getRemoteStackTrace

          public String getRemoteStackTrace()

      Returns the textual stack trace associated with the remote fault exception, or null if the error occurred locally. This method exists primarily for logging, testing and debugging.

    - #### toString

          public String toString()

      Returns a description of the fault that includes the standard `Throwable` description (class name and message), followed by the fault class name, followed by the remote stack trace (if any). This method exists primarily for logging, testing and debugging.
      Overrides:
        `toString` in class `Throwable`

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.