Source
bool get isErrorOrException { bool _doCheck(InterfaceType type) { return (type.element.library.isDartCore && (type.name == 'Exception' || type.name == 'Error')); } // if this class is itself Error or Exception, return true if (_doCheck(_cls.type)) return true; return _cls.allSupertypes.any(_doCheck); }