AutoCat/AutoCatCore/Extensions/Error+Canceled.swift

20 lines
381 B
Swift

//
// Error+Canceled.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 19.02.2025.
// Copyright © 2025 Selim Mustafaev. All rights reserved.
//
import Foundation
extension Error {
public var isCanceled: Bool {
let nsError = self as NSError
return nsError.domain == NSURLErrorDomain
&& nsError.code == NSURLErrorCancelled
}
}