WebException.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //Copyright 2010 Microsoft Corporation
  2. //
  3. //Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
  9. //"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. //See the License for the specific language governing permissions and limitations under the License.
  11. namespace System.Data.Services.Http
  12. {
  13. using System;
  14. internal sealed class WebException : InvalidOperationException
  15. {
  16. private HttpWebResponse response;
  17. public WebException()
  18. {
  19. }
  20. public WebException(string message) : this(message, (Exception) null)
  21. {
  22. }
  23. public WebException(string message, Exception innerException) : base(message, innerException)
  24. {
  25. }
  26. public WebException(string message, Exception innerException, HttpWebResponse response)
  27. : base(message, innerException)
  28. {
  29. this.response = response;
  30. }
  31. public System.Data.Services.Http.HttpWebResponse Response
  32. {
  33. get
  34. {
  35. return this.response;
  36. }
  37. }
  38. internal static WebException CreateInternal(string location)
  39. {
  40. return new WebException(System.Data.Services.Client.Strings.HttpWeb_Internal(location));
  41. }
  42. }
  43. }