RemoteException (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ipc, class: RemoteException

Package org.apache.hadoop.ipc

# Class RemoteException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.hadoop.ipc.RemoteException

All Implemented Interfaces:
  `Serializable`

public class RemoteException extends IOException

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RemoteException(String className, String msg)`
  `RemoteException(String className, String msg, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.RpcErrorCodeProto erCode)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getClassName()`
  `org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.RpcErrorCodeProto`
  `getErrorCode()`
  `String`
  `toString()`
  `IOException`
  `unwrapRemoteException()`
  Instantiate and return the exception wrapped up by this remote exception.
  `IOException`
  `unwrapRemoteException(Class<?>... lookupTypes)`
  If this remote exception wraps up one of the lookupTypes then return this exception.
  `static RemoteException`
  `valueOf(Attributes attrs)`
  Create RemoteException from attributes.

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

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

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

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

- ## Constructor Details

  - ### RemoteException

    public RemoteException(String className, String msg)
    Parameters:
      `className` - wrapped exception, may be null
      `msg` - may be null

  - ### RemoteException

    public RemoteException(String className, String msg, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.RpcErrorCodeProto erCode)
    Parameters:
      `className` - wrapped exception, may be null
      `msg` - may be null
      `erCode` - may be null

- ## Method Details

  - ### getClassName

    public String getClassName()
    Returns:
      the class name for the wrapped exception; may be null if none was given.

  - ### getErrorCode

    public org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcResponseHeaderProto.RpcErrorCodeProto getErrorCode()
    Returns:
      may be null if the code was newer than our protobuf definitions or none was given.

  - ### unwrapRemoteException

    public IOException unwrapRemoteException(Class<?>... lookupTypes)
    If this remote exception wraps up one of the lookupTypes then return this exception.

    Unwraps any IOException.

    Parameters:
      `lookupTypes` - the desired exception class. may be null.
    Returns:
      IOException, which is either the lookupClass exception or this.

  - ### unwrapRemoteException

    public IOException unwrapRemoteException()
    Instantiate and return the exception wrapped up by this remote exception.

    This unwraps any `Throwable` that has a constructor taking a `String` as a parameter. Otherwise it returns this.

    Returns:
      `Throwable`

  - ### valueOf

    public static RemoteException valueOf(Attributes attrs)
    Create RemoteException from attributes.
    Parameters:
      `attrs` - may not be null.
    Returns:
      RemoteException.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Throwable`