handle<S extends Error> method

T? handle<S extends Error>(
  1. S error
)

takes an Error S and returns T? calling HandleError if Error is of the correct Type

Implementation

T? handle<S extends Error>(S error) {
  if (error is T) {
    this(error);
    return error;
  }
  return null;
}