checkBaseError<E extends SampleException> method

bool checkBaseError<E extends SampleException>([
  1. String? errorCode
])

return true if the first exception in tree same errorCode

Implementation

core.bool checkBaseError<E extends SampleException>([String? errorCode]) {
  final base = baseError();
  if (errorCode != null) {
    return base.errorCode == errorCode && base is E;
  } else {
    return base is E;
  }
}