@@ -17,17 +17,39 @@ public static WebException ToWebException(this ResponseStatus responseStatus)
17
17
{
18
18
case ResponseStatus . None :
19
19
return new WebException ( "The request could not be processed." ,
20
- WebExceptionStatus . ServerProtocolViolation ) ;
20
+ #if ! SILVERLIGHT
21
+ WebExceptionStatus . ServerProtocolViolation
22
+ #else
23
+ WebExceptionStatus . UnknownError
24
+ #endif
25
+ ) ;
21
26
22
27
case ResponseStatus . Error :
23
28
return new WebException ( "An error occurred while processing the request." ,
24
- WebExceptionStatus . ServerProtocolViolation ) ;
29
+ #if ! SILVERLIGHT
30
+ WebExceptionStatus . ServerProtocolViolation
31
+ #else
32
+ WebExceptionStatus . UnknownError
33
+ #endif
34
+ ) ;
25
35
26
36
case ResponseStatus . TimedOut :
27
- return new WebException ( "The request timed-out." , WebExceptionStatus . Timeout ) ;
37
+ return new WebException ( "The request timed-out." ,
38
+ #if ! SILVERLIGHT
39
+ WebExceptionStatus . Timeout
40
+ #else
41
+ WebExceptionStatus . UnknownError
42
+ #endif
43
+ ) ;
28
44
29
45
case ResponseStatus . Aborted :
30
- return new WebException ( "The request was aborted." , WebExceptionStatus . Timeout ) ;
46
+ return new WebException ( "The request was aborted." ,
47
+ #if ! SILVERLIGHT
48
+ WebExceptionStatus . Timeout
49
+ #else
50
+ WebExceptionStatus . RequestCanceled
51
+ #endif
52
+ ) ;
31
53
32
54
default :
33
55
throw new ArgumentOutOfRangeException ( "responseStatus" ) ;
0 commit comments