1
/* Copyright (c) 2006 Google Inc.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
15
#region Using directives
23
using System.Diagnostics;
24
#if WindowsCE || PocketPC
26
using System.Runtime.Serialization;
28
using System.Security.Permissions;
37
//////////////////////////////////////////////////////////////////////
38
// <summary>custom exceptions</summary>
39
//////////////////////////////////////////////////////////////////////
40
namespace Google.GData.Client
43
//////////////////////////////////////////////////////////////////////
44
/// <summary>standard exception class to be used when authentication
45
/// using Google Client Login fails
47
//////////////////////////////////////////////////////////////////////
48
#if WindowsCE || PocketPC
52
public class AuthenticationException : LoggedException
54
//////////////////////////////////////////////////////////////////////
55
/// <summary>default constructor so that FxCop does not complain</summary>
56
//////////////////////////////////////////////////////////////////////
57
public AuthenticationException() {}
60
/// base constructor, takes a message text
62
/// <param name="msg"></param>
63
public AuthenticationException(String msg) : base(msg) {}
66
/// default constructor
68
/// <param name="msg">message for exception</param>
69
/// <param name="e">inner exception</param>
70
public AuthenticationException(String msg, Exception e) : base(msg,e) { }
73
/// <summary>thrown when the credentials are wrong</summary>
74
#if WindowsCE || PocketPC
78
public class InvalidCredentialsException : AuthenticationException
80
//////////////////////////////////////////////////////////////////////
81
/// <summary>default constructor so that FxCop does not complain</summary>
82
//////////////////////////////////////////////////////////////////////
83
public InvalidCredentialsException() {}
84
//////////////////////////////////////////////////////////////////////
85
/// <summary>constructor taking a descriptive string</summary>
86
//////////////////////////////////////////////////////////////////////
87
public InvalidCredentialsException(String msg) : base(msg) {}
90
/// default constructor
92
/// <param name="msg">message for exception</param>
93
/// <param name="e">inner exception</param>
94
public InvalidCredentialsException(String msg, Exception e) : base(msg, e) { }
98
//////////////////////////////////////////////////////////////////////
99
/// <summary>thrown when the account was deleted
101
//////////////////////////////////////////////////////////////////////
102
#if WindowsCE || PocketPC
106
public class AccountDeletedException : AuthenticationException
108
//////////////////////////////////////////////////////////////////////
109
/// <summary>default constructor so that FxCop does not complain</summary>
110
//////////////////////////////////////////////////////////////////////
111
public AccountDeletedException() {}
112
//////////////////////////////////////////////////////////////////////
113
/// <summary>constructor taking a descriptive string</summary>
114
//////////////////////////////////////////////////////////////////////
115
public AccountDeletedException(String msg) : base(msg) {}
118
/// default constructor
120
/// <param name="msg">message for exception</param>
121
/// <param name="e">inner exception</param>
122
public AccountDeletedException(String msg, Exception e) : base(msg, e) { }
126
//////////////////////////////////////////////////////////////////////
127
/// <summary>thrown when the account was disabled
129
//////////////////////////////////////////////////////////////////////
130
#if WindowsCE || PocketPC
134
public class AccountDisabledException : AuthenticationException
136
//////////////////////////////////////////////////////////////////////
137
/// <summary>default constructor so that FxCop does not complain</summary>
138
//////////////////////////////////////////////////////////////////////
139
public AccountDisabledException() {}
140
//////////////////////////////////////////////////////////////////////
141
/// <summary>constructor taking a descriptive string</summary>
142
//////////////////////////////////////////////////////////////////////
143
public AccountDisabledException(String msg) : base(msg) {}
146
/// default constructor
148
/// <param name="msg">message for exception</param>
149
/// <param name="e">inner exception</param>
150
public AccountDisabledException(String msg, Exception e) : base(msg, e) { }
154
//////////////////////////////////////////////////////////////////////
155
/// <summary>the account hoder was not verified
157
//////////////////////////////////////////////////////////////////////
158
#if WindowsCE || PocketPC
162
public class NotVerifiedException : AuthenticationException
164
//////////////////////////////////////////////////////////////////////
165
/// <summary>default constructor so that FxCop does not complain</summary>
166
//////////////////////////////////////////////////////////////////////
167
public NotVerifiedException() {}
168
//////////////////////////////////////////////////////////////////////
169
/// <summary>constructor taking a descriptive string</summary>
170
//////////////////////////////////////////////////////////////////////
171
public NotVerifiedException(String msg) : base(msg) {}
174
/// default constructor
176
/// <param name="msg">message for exception</param>
177
/// <param name="e">inner exception</param>
178
public NotVerifiedException(String msg, Exception e) : base(msg, e) { }
182
//////////////////////////////////////////////////////////////////////
183
/// <summary>The Terms were not agreed with..
185
//////////////////////////////////////////////////////////////////////
186
#if WindowsCE || PocketPC
190
public class TermsNotAgreedException : AuthenticationException
192
//////////////////////////////////////////////////////////////////////
193
/// <summary>default constructor so that FxCop does not complain</summary>
194
//////////////////////////////////////////////////////////////////////
195
public TermsNotAgreedException() {}
196
//////////////////////////////////////////////////////////////////////
197
/// <summary>constructor taking a descriptive string</summary>
198
//////////////////////////////////////////////////////////////////////
199
public TermsNotAgreedException(String msg) : base(msg) {}
202
/// default constructor
204
/// <param name="msg">message for exception</param>
205
/// <param name="e">inner exception</param>
206
public TermsNotAgreedException(String msg, Exception e) : base(msg, e) { }
210
//////////////////////////////////////////////////////////////////////
211
/// <summary>The service is current not available
213
//////////////////////////////////////////////////////////////////////
214
#if WindowsCE || PocketPC
218
public class ServiceUnavailableException : AuthenticationException
220
//////////////////////////////////////////////////////////////////////
221
/// <summary>default constructor so that FxCop does not complain</summary>
222
//////////////////////////////////////////////////////////////////////
223
public ServiceUnavailableException() {}
224
//////////////////////////////////////////////////////////////////////
225
/// <summary>constructor taking a descriptive string</summary>
226
//////////////////////////////////////////////////////////////////////
227
public ServiceUnavailableException(String msg) : base(msg) {}
230
/// default constructor
232
/// <param name="msg">message for exception</param>
233
/// <param name="e">inner exception</param>
234
public ServiceUnavailableException(String msg, Exception e) : base(msg, e) { }
238
//////////////////////////////////////////////////////////////////////
239
/// <summary>many unsuccessfull logins might create this...
241
//////////////////////////////////////////////////////////////////////
242
#if WindowsCE || PocketPC
246
public class CaptchaRequiredException : AuthenticationException
248
private string captchaUrl;
249
private string captchaToken;
251
//////////////////////////////////////////////////////////////////////
252
/// <summary>default constructor so that FxCop does not complain</summary>
253
//////////////////////////////////////////////////////////////////////
254
public CaptchaRequiredException() {}
256
//////////////////////////////////////////////////////////////////////
257
/// <summary>constructor taking a descriptive string</summary>
258
//////////////////////////////////////////////////////////////////////
259
public CaptchaRequiredException(String msg, String url, String token) : base(msg)
261
this.captchaUrl = url;
262
this.captchaToken = token;
266
/// default constructor
268
/// <param name="msg">message for exception</param>
269
/// <param name="e">inner exception</param>
270
public CaptchaRequiredException(String msg, Exception e) : base(msg, e) { }
274
//////////////////////////////////////////////////////////////////////
275
/// <summary>Read only accessor for captchaUrl</summary>
276
//////////////////////////////////////////////////////////////////////
279
get {return this.captchaUrl;}
281
// end of accessor for captchaUrl
283
//////////////////////////////////////////////////////////////////////
284
/// <summary>Read only accessor for captchaToken</summary>
285
//////////////////////////////////////////////////////////////////////
288
get {return this.captchaToken;}
290
// end of accessor for captchaToken
293
} //end of file //////////////////////////////////////////////////////////////////////////