bool ResourceError::compare(const ResourceError& a, const ResourceError& b) { if (a.isNull() && b.isNull()) return true; if (a.isNull() || b.isNull()) return false; if (a.domain() != b.domain()) return false; if (a.errorCode() != b.errorCode()) return false; if (a.failingURL() != b.failingURL()) return false; if (a.localizedDescription() != b.localizedDescription()) return false; if (a.isCancellation() != b.isCancellation()) return false; if (a.isAccessCheck() != b.isAccessCheck()) return false; if (a.isTimeout() != b.isTimeout()) return false; if (a.staleCopyInCache() != b.staleCopyInCache()) return false; if (a.wasIgnoredByHandler() != b.wasIgnoredByHandler()) return false; return true; }