com.google.cloud.dataflow.sdk.coders

## Class CannotProvideCoderException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.google.cloud.dataflow.sdk.coders.CannotProvideCoderException

All Implemented Interfaces:
  Serializable

    public class CannotProvideCoderException
    extends Exception

The exception thrown when a `CoderProvider` cannot provide a `Coder` that has been requested.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `CannotProvideCoderException.ReasonCode` Indicates the reason that `Coder` inference failed.

### Constructor Summary

Constructors
Constructor and Description
`CannotProvideCoderException(String message)`
`CannotProvideCoderException(String message, CannotProvideCoderException.ReasonCode reason)`
`CannotProvideCoderException(String message, Throwable cause)`
`CannotProvideCoderException(String message, Throwable cause, CannotProvideCoderException.ReasonCode reason)`
`CannotProvideCoderException(Throwable cause)`
`CannotProvideCoderException(Throwable cause, CannotProvideCoderException.ReasonCode reason)`

### Method Summary

All Methods Instance Methods Concrete Methods
`CannotProvideCoderException.ReasonCode` `getReason()`
`Throwable` `getRootCause()` Returns the inner-most `CannotProvideCoderException` when they are deeply nested.

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

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, 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

#### CannotProvideCoderException

    public CannotProvideCoderException(String message)

#### CannotProvideCoderException

    public CannotProvideCoderException(String message,
                                       CannotProvideCoderException.ReasonCode reason)

#### CannotProvideCoderException

    public CannotProvideCoderException(String message,
                                       Throwable cause)

#### CannotProvideCoderException

    public CannotProvideCoderException(String message,
                                       Throwable cause,
                                       CannotProvideCoderException.ReasonCode reason)

#### CannotProvideCoderException

    public CannotProvideCoderException(Throwable cause)

#### CannotProvideCoderException

    public CannotProvideCoderException(Throwable cause,
                                       CannotProvideCoderException.ReasonCode reason)

### Method Detail

#### getReason

    public CannotProvideCoderException.ReasonCode getReason()

Returns:
  the reason that Coder inference failed.

#### getRootCause

    public Throwable getRootCause()

Returns the inner-most `CannotProvideCoderException` when they are deeply nested.

For example, if a coder for `List<KV<Integer, Whatsit>>` cannot be provided because there is no known coder for `Whatsit`, the root cause of the exception should be a CannotProvideCoderException with details pertinent to `Whatsit`, suppressing the intermediate layers.