blob: c161ee3937b9cae657a1a9723be0fb39cdda7ee7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
//
// RelayCacheError.swift
// RelayCacheError
//
// Created by pronebird on 27/07/2021.
// Copyright © 2021 Mullvad VPN AB. All rights reserved.
//
import Foundation
extension RelayCache {
/// Error emitted by RelayCache cluster.
enum Error: ChainedError {
case readCache(Swift.Error)
case readPrebundledRelays(Swift.Error)
case decodePrebundledRelays(Swift.Error)
case writeCache(Swift.Error)
case encodeCache(Swift.Error)
case decodeCache(Swift.Error)
case rest(REST.Error)
case backgroundTaskScheduler(Swift.Error)
var errorDescription: String? {
switch self {
case .encodeCache:
return "Encode cache error"
case .decodeCache:
return "Decode cache error"
case .readCache:
return "Read cache error"
case .readPrebundledRelays:
return "Read pre-bundled relays error"
case .decodePrebundledRelays:
return "Decode pre-bundled relays error"
case .writeCache:
return "Write cache error"
case .rest:
return "REST error"
case .backgroundTaskScheduler:
return "Background task scheduler error"
}
}
}
}
|