This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
/
DBException.cs
83 lines (59 loc) · 2.11 KB
/
DBException.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
namespace DropBoxSync.iOS
{
public class DBException : Exception
{
public DBError NativeError { get; private set; }
public DBException (DBError err)
{
NativeError = err;
}
public override string Message {
get {
switch (NativeError.Code) {
case DBErrorCode.CoreSystem:
return "System error";
case DBErrorCode.Params:
return "An error due to data passed into the SDK";
case DBErrorCode.ParamsInvalid:
return "A parameter is invalid, maybe was null?";
case DBErrorCode.ParamsNotFound:
return "A file corresponding to a provided path was not found";
case DBErrorCode.ParamsExists:
return "File already exists and was opened exclusively";
case DBErrorCode.ParamsAlreadyOpen:
return "File was already open";
case DBErrorCode.ParamsParent:
return "Parent does not exist or is not a folder";
case DBErrorCode.ParamsNotEmpty:
return "Directory is not empty";
case DBErrorCode.ParamsNotCached:
return "File was not yet in cache";
case DBErrorCode.System:
return "An error in the Dropbox library occurred";
case DBErrorCode.SystemDiskSpace:
return "An error happened due to insufficient disk space";
case DBErrorCode.Network:
return "An error occurred making a network request";
case DBErrorCode.NetworkTimeout:
return "A connection timed out";
case DBErrorCode.NetworkNoConnection:
return "No network connection available";
case DBErrorCode.NetworkSSL:
return "Unable to verify the server's SSL certificate. Often caused by an out-of-date clock";
case DBErrorCode.NetworkServer:
return "Unexpected server error";
case DBErrorCode.Auth:
return "An authentication related problem occurred";
case DBErrorCode.AuthUnlinked:
return "The user is no longer linked";
case DBErrorCode.AuthInvalidApp:
return "An invalid app key or secret was provided";
case DBErrorCode.Unknown:
default:
return "Unknown Error";
}
}
}
}
}