mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 08:13:26 +01:00
Replace local code with updated Roxas and SideKit
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
This commit is contained in:
committed by
Joe Mattiello
parent
4e84dc4cc8
commit
f270ecc537
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// ALTServerError+Conveniences.swift
|
||||
// AltKit
|
||||
//
|
||||
// Created by Riley Testut on 6/4/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AltSign
|
||||
|
||||
public extension ALTServerError
|
||||
{
|
||||
init<E: Error>(_ error: E)
|
||||
{
|
||||
switch error
|
||||
{
|
||||
case let error as ALTServerError: self = error
|
||||
case let error as ALTServerConnectionError: self = ALTServerError(.connectionFailed, underlyingError: error)
|
||||
case let error as ALTAppleAPIError where error.code == .invalidAnisetteData: self = ALTServerError(.invalidAnisetteData, underlyingError: error)
|
||||
case is DecodingError: self = ALTServerError(.invalidRequest, underlyingError: error)
|
||||
case is EncodingError: self = ALTServerError(.invalidResponse, underlyingError: error)
|
||||
case let error as NSError:
|
||||
var userInfo = error.userInfo
|
||||
if !userInfo.keys.contains(NSUnderlyingErrorKey)
|
||||
{
|
||||
// Assign underlying error (if there isn't already one).
|
||||
userInfo[NSUnderlyingErrorKey] = error
|
||||
}
|
||||
|
||||
self = ALTServerError(.underlyingError, userInfo: userInfo)
|
||||
}
|
||||
}
|
||||
|
||||
init<E: Error>(_ code: ALTServerError.Code, underlyingError: E)
|
||||
{
|
||||
self = ALTServerError(code, userInfo: [NSUnderlyingErrorKey: underlyingError])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user