BadRequestException.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Net;
  3. namespace OSHttpServer.Exceptions
  4. {
  5. /// <summary>
  6. /// The request could not be understood by the server due to malformed syntax.
  7. /// The client SHOULD NOT repeat the request without modifications.
  8. ///
  9. /// Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php
  10. /// </summary>
  11. public class BadRequestException : HttpException
  12. {
  13. /// <summary>
  14. /// Create a new bad request exception.
  15. /// </summary>
  16. /// <param name="errMsg">reason to why the request was bad.</param>
  17. public BadRequestException(string errMsg)
  18. : base(HttpStatusCode.BadRequest, errMsg)
  19. {
  20. }
  21. /// <summary>
  22. /// Create a new bad request exception.
  23. /// </summary>
  24. /// <param name="errMsg">reason to why the request was bad.</param>
  25. /// <param name="inner">inner exception</param>
  26. public BadRequestException(string errMsg, Exception inner)
  27. : base(HttpStatusCode.BadRequest, errMsg, inner)
  28. {
  29. }
  30. }
  31. }