2025-10-07 22:32:54 +00:00
|
|
|
// ===----------------------------------------------------------------------===
|
|
|
|
|
//
|
|
|
|
|
// This source file is part of the Amiibo Service open source project
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) 2025 Röck+Cöde VoF. and the Amiibo Service project authors
|
|
|
|
|
// Licensed under Apache license v2.0
|
|
|
|
|
//
|
2024-09-14 22:26:39 +00:00
|
|
|
// See LICENSE for license information
|
2025-10-07 22:32:54 +00:00
|
|
|
// See CONTRIBUTORS for the list of Amiibo Service project authors
|
2024-09-14 22:26:39 +00:00
|
|
|
//
|
2025-10-07 22:32:54 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
//
|
|
|
|
|
// ===----------------------------------------------------------------------===
|
2024-09-14 22:26:39 +00:00
|
|
|
|
2025-09-09 17:30:19 +00:00
|
|
|
/// A representation of all the possible errors that the ``AmiiboService`` service could throw.
|
2024-09-14 22:26:39 +00:00
|
|
|
public enum AmiiboServiceError: Error {
|
2025-09-09 17:30:19 +00:00
|
|
|
/// A bad request has been given to the client.
|
2024-09-14 22:26:39 +00:00
|
|
|
case badRequest
|
2025-10-02 01:51:16 +00:00
|
|
|
/// A call to an endpoint has been cancelled by the user.
|
|
|
|
|
case cancelled
|
2025-09-09 17:30:19 +00:00
|
|
|
/// A response cannot be decoded.
|
2024-09-14 22:26:39 +00:00
|
|
|
case decoding
|
2025-09-09 17:30:19 +00:00
|
|
|
/// An online service is not currently available.
|
2024-09-14 22:26:39 +00:00
|
|
|
case notAvailable
|
2025-09-09 17:30:19 +00:00
|
|
|
/// A response cannot be found.
|
2024-09-14 22:26:39 +00:00
|
|
|
case notFound
|
2025-09-09 17:30:19 +00:00
|
|
|
/// An undocumented/unsupported status code error.
|
2024-09-14 22:26:39 +00:00
|
|
|
case undocumented(_ statusCode: Int)
|
2025-09-09 17:30:19 +00:00
|
|
|
/// An unknown error.
|
2024-09-14 22:26:39 +00:00
|
|
|
case unknown
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MARK: - Equatable
|
|
|
|
|
|
|
|
|
|
extension AmiiboServiceError: Equatable {}
|