onReturn method

FutureOr<R> onReturn(
  1. A arg,
  2. R response
)

Hook method that is called after the next handler returns normally.

Returns the same type as the next handler's return type. By default the response is returned unchanged.

If it throws, the call chain is aborted and the exception propagates to the caller.

Implementation

FutureOr<R> onReturn(final A arg, final R response) {
  return response;
}