...
Code Block | ||||
---|---|---|---|---|
| ||||
class StreamsException {
// New constructors
public StreamsException(final String message, final TaskId taskId);
public StreamsException(final Throwable throwable, final TaskId taskId);
public StreamsException(final String message, final Throwable throwable, final TaskId taskId);
/**
* @return the {@link TaskId} that this exception originated from, or {@link Optional#empty()} if the exception
* cannot be traced back to a particular task. Note that the {@code TaskId} being empty does not
* guarantee that the exception wasn't directly related to a specific task.
*/
public Optional<TaskId> taskId() {
return taskId;
}
} |
...
- Guarantee that every exception that is thrown up to the uncaught exception handler, whether that be the new StreamsUncaughtExceptionHandler or the old generic UncaughtExceptionHandler, is wrapped as a StreamsException.
- Add a new TaskId field to the StreamsException class, with a getter API to expose it and corresponding constructors. This field will be set for any exception that originates from, or is tied to, a specific task. For example:
- Task timeout (ie exceeds the configured task.timeout.ms value
- User processing error or other exception thrown from Task#process
- Exceptions arising from task management, such as suspending/closing/flushing/etc
...