Added support for new errors inside some helper function for the AmiiboLiveClient type in the library target.
This commit is contained in:
@@ -202,6 +202,10 @@ private extension AmiiboLiveClient {
|
|||||||
}
|
}
|
||||||
case .badRequest:
|
case .badRequest:
|
||||||
throw AmiiboServiceError.badRequest
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
case let .undocumented(statusCode, _):
|
case let .undocumented(statusCode, _):
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
}
|
}
|
||||||
@@ -365,6 +369,12 @@ private extension AmiiboLiveClient {
|
|||||||
case let .json(output):
|
case let .json(output):
|
||||||
return output.lastUpdated
|
return output.lastUpdated
|
||||||
}
|
}
|
||||||
|
case .badRequest:
|
||||||
|
throw AmiiboServiceError.badRequest
|
||||||
|
case .notFound:
|
||||||
|
throw AmiiboServiceError.notFound
|
||||||
|
case .internalServerError:
|
||||||
|
throw AmiiboServiceError.notAvailable
|
||||||
case let .undocumented(statusCode, _):
|
case let .undocumented(statusCode, _):
|
||||||
throw AmiiboServiceError.undocumented(statusCode)
|
throw AmiiboServiceError.undocumented(statusCode)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user