Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-28 21:26:51 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-28 21:26:51 +0400
commitde80b74af3cdaabb8ea5e7bfd147c988dd3d867f (patch)
treefacbf89e345a3002f00a682fa019d4541a155855 /mcs/class/System
parent1925fbede7f95119530b8adf0a6319067fc93a6e (diff)
2009-07-28 Gonzalo Paniagua Javier <gonzalo@novell.com>
* WebClient.cs: rethrow WebExceptions instead of creating a new one with less information on the actual error. Fixes bug #526069. svn path=/trunk/mcs/; revision=138855
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/System.Net/ChangeLog6
-rw-r--r--mcs/class/System/System.Net/WebClient.cs12
2 files changed, 18 insertions, 0 deletions
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
index 61810bfcfdc..275ff55d53b 100644
--- a/mcs/class/System/System.Net/ChangeLog
+++ b/mcs/class/System/System.Net/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-28 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * WebClient.cs: rethrow WebExceptions instead of creating a new one
+ with less information on the actual error.
+ Fixes bug #526069.
+
2009-07-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
* WebHeaderCollection.cs: check the validity of the characters in the
diff --git a/mcs/class/System/System.Net/WebClient.cs b/mcs/class/System/System.Net/WebClient.cs
index 050f7904ea6..18a9b48881c 100644
--- a/mcs/class/System/System.Net/WebClient.cs
+++ b/mcs/class/System/System.Net/WebClient.cs
@@ -279,6 +279,8 @@ namespace System.Net
if (request != null)
request.Abort ();
throw;
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);
@@ -315,6 +317,8 @@ namespace System.Net
async = false;
#endif
DownloadFileCore (address, fileName, null);
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);
@@ -391,6 +395,8 @@ namespace System.Net
request = SetupRequest (address);
WebResponse response = GetWebResponse (request);
return response.GetResponseStream ();
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);
@@ -446,6 +452,8 @@ namespace System.Net
#endif
WebRequest request = SetupRequest (address, method, true);
return request.GetRequestStream ();
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);
@@ -594,6 +602,8 @@ namespace System.Net
async = false;
#endif
return UploadFileCore (address, method, fileName, null);
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);
@@ -715,6 +725,8 @@ namespace System.Net
async = false;
#endif
return UploadValuesCore (address, method, data, null);
+ } catch (WebException wexc) {
+ throw;
} catch (Exception ex) {
throw new WebException ("An error occurred " +
"performing a WebClient request.", ex);