ForbiddenException.cs 1.0 KB

12345678910111213141516171819202122232425
  1. using System.Net;
  2. namespace OSHttpServer.Exceptions
  3. {
  4. /// <summary>
  5. /// The server understood the request, but is refusing to fulfill it.
  6. /// Authorization will not help and the request SHOULD NOT be repeated.
  7. /// If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled,
  8. /// it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information
  9. /// available to the client, the status code 404 (Not Found) can be used instead.
  10. ///
  11. /// Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php
  12. /// </summary>
  13. public class ForbiddenException : HttpException
  14. {
  15. /// <summary>
  16. /// Initializes a new instance of the <see cref="ForbiddenException"/> class.
  17. /// </summary>
  18. /// <param name="errorMsg">error message</param>
  19. public ForbiddenException(string errorMsg)
  20. : base(HttpStatusCode.Forbidden, errorMsg)
  21. {
  22. }
  23. }
  24. }