summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/exception.h275
1 files changed, 275 insertions, 0 deletions
diff --git a/include/sitecing/exception.h b/include/sitecing/exception.h
index 985fc6d..857a8e6 100644
--- a/include/sitecing/exception.h
+++ b/include/sitecing/exception.h
@@ -43,6 +43,10 @@ namespace sitecing {
*/
class http_status_1xx : public http_status {
public:
+ /**
+ * @param s HTTP status
+ * @param m HTTP status message
+ */
explicit http_status_1xx(const string &s,const string& m)
: http_status(s,m) { }
};
@@ -51,6 +55,9 @@ namespace sitecing {
*/
class http_status_100 : public http_status_1xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_100(const string& m)
: http_status_1xx("100",m) { }
explicit http_status_100()
@@ -61,6 +68,9 @@ namespace sitecing {
*/
class http_status_101 : public http_status_1xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_101(const string& m)
: http_status_1xx("101",m) { }
explicit http_status_101()
@@ -72,6 +82,10 @@ namespace sitecing {
*/
class http_status_2xx : public http_status {
public:
+ /**
+ * @param s HTTP status message
+ * @param m HTTP status message
+ */
explicit http_status_2xx(const string& s,const string& m)
: http_status(s,m) { }
};
@@ -80,6 +94,9 @@ namespace sitecing {
*/
class http_status_200 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_200(const string& m)
: http_status_2xx("200",m) { }
explicit http_status_200()
@@ -90,6 +107,9 @@ namespace sitecing {
*/
class http_status_201 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_201(const string& m)
: http_status_2xx("201",m) { }
explicit http_status_201()
@@ -100,6 +120,9 @@ namespace sitecing {
*/
class http_status_202 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_202(const string& m)
: http_status_2xx("202",m) { }
explicit http_status_202()
@@ -110,6 +133,9 @@ namespace sitecing {
*/
class http_status_203 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_203(const string& m)
: http_status_2xx("203",m) { }
explicit http_status_203()
@@ -120,6 +146,9 @@ namespace sitecing {
*/
class http_status_204 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_204(const string& m)
: http_status_2xx("204",m) { }
explicit http_status_204()
@@ -130,6 +159,9 @@ namespace sitecing {
*/
class http_status_205 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_205(const string& m)
: http_status_2xx("205",m) { }
explicit http_status_205()
@@ -140,6 +172,9 @@ namespace sitecing {
*/
class http_status_206 : public http_status_2xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_206(const string& m)
: http_status_2xx("206",m) { }
explicit http_status_206()
@@ -151,6 +186,10 @@ namespace sitecing {
*/
class http_status_3xx : public http_status {
public:
+ /**
+ * @param s HTTP status
+ * @param m HTTP status message
+ */
explicit http_status_3xx(const string& s,const string& m)
: http_status(s,m) { }
};
@@ -159,6 +198,9 @@ namespace sitecing {
*/
class http_status_300 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_300(const string& m)
: http_status_3xx("300",m) { }
explicit http_status_300()
@@ -169,6 +211,9 @@ namespace sitecing {
*/
class http_status_301 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_301(const string& m)
: http_status_3xx("301",m) { }
explicit http_status_301()
@@ -179,6 +224,9 @@ namespace sitecing {
*/
class http_status_302 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_302(const string& m)
: http_status_3xx("302",m) { }
explicit http_status_302()
@@ -189,6 +237,9 @@ namespace sitecing {
*/
class http_status_303 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_303(const string& m)
: http_status_3xx("303",m) { }
explicit http_status_303()
@@ -199,6 +250,9 @@ namespace sitecing {
*/
class http_status_304 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_304(const string& m)
: http_status_3xx("304",m) { }
explicit http_status_304()
@@ -209,6 +263,9 @@ namespace sitecing {
*/
class http_status_305 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_305(const string& m)
: http_status_3xx("305",m) { }
explicit http_status_305()
@@ -220,6 +277,9 @@ namespace sitecing {
*/
class http_status_307 : public http_status_3xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_307(const string& m)
: http_status_3xx("307",m) { }
explicit http_status_307()
@@ -231,6 +291,10 @@ namespace sitecing {
*/
class http_status_4xx : public http_status {
public:
+ /**
+ * @param s HTTP status
+ * @param m HTTP status message
+ */
explicit http_status_4xx(const string& s,const string& m)
: http_status(s,m) { }
};
@@ -239,6 +303,9 @@ namespace sitecing {
*/
class http_status_400 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_400(const string& m)
: http_status_4xx("400",m) { }
explicit http_status_400()
@@ -249,6 +316,9 @@ namespace sitecing {
*/
class http_status_401 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_401(const string& m)
: http_status_4xx("401",m) { }
explicit http_status_401()
@@ -259,6 +329,9 @@ namespace sitecing {
*/
class http_status_402 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_402(const string& m)
: http_status_4xx("402",m) { }
explicit http_status_402()
@@ -269,6 +342,9 @@ namespace sitecing {
*/
class http_status_403 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_403(const string& m)
: http_status_4xx("403",m) { }
explicit http_status_403()
@@ -279,6 +355,9 @@ namespace sitecing {
*/
class http_status_404 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_404(const string& m)
: http_status_4xx("404",m) { }
explicit http_status_404()
@@ -289,6 +368,9 @@ namespace sitecing {
*/
class http_status_405 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_405(const string& m)
: http_status_4xx("405",m) { }
explicit http_status_405()
@@ -299,6 +381,9 @@ namespace sitecing {
*/
class http_status_406 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_406(const string& m)
: http_status_4xx("406",m) { }
explicit http_status_406()
@@ -309,6 +394,9 @@ namespace sitecing {
*/
class http_status_407 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_407(const string& m)
: http_status_4xx("407",m) { }
explicit http_status_407()
@@ -319,6 +407,9 @@ namespace sitecing {
*/
class http_status_408 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_408(const string& m)
: http_status_4xx("408",m) { }
explicit http_status_408()
@@ -329,6 +420,9 @@ namespace sitecing {
*/
class http_status_409 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_409(const string& m)
: http_status_4xx("409",m) { }
explicit http_status_409()
@@ -339,6 +433,9 @@ namespace sitecing {
*/
class http_status_410 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_410(const string& m)
: http_status_4xx("410",m) { }
explicit http_status_410()
@@ -349,6 +446,9 @@ namespace sitecing {
*/
class http_status_411 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_411(const string& m)
: http_status_4xx("411",m) { }
explicit http_status_411()
@@ -359,6 +459,9 @@ namespace sitecing {
*/
class http_status_412 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_412(const string& m)
: http_status_4xx("412",m) { }
explicit http_status_412()
@@ -369,6 +472,9 @@ namespace sitecing {
*/
class http_status_413 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_413(const string& m)
: http_status_4xx("413",m) { }
explicit http_status_413()
@@ -379,6 +485,9 @@ namespace sitecing {
*/
class http_status_414 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_414(const string& m)
: http_status_4xx("414",m) { }
explicit http_status_414()
@@ -389,6 +498,9 @@ namespace sitecing {
*/
class http_status_415 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_415(const string& m)
: http_status_4xx("415",m) { }
explicit http_status_415()
@@ -399,6 +511,9 @@ namespace sitecing {
*/
class http_status_416 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_416(const string& m)
: http_status_4xx("416",m) { }
explicit http_status_416()
@@ -409,6 +524,9 @@ namespace sitecing {
*/
class http_status_417 : public http_status_4xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_417(const string& m)
: http_status_4xx("417",m) { }
explicit http_status_417()
@@ -420,6 +538,10 @@ namespace sitecing {
*/
class http_status_5xx : public http_status {
public:
+ /**
+ * @param s HTTP status
+ * @param m HTTP status message
+ */
explicit http_status_5xx(const string& s,const string& m)
: http_status(s,m) { }
};
@@ -428,6 +550,9 @@ namespace sitecing {
*/
class http_status_500 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_500(const string& m)
: http_status_5xx("500",m) { }
explicit http_status_500()
@@ -438,6 +563,9 @@ namespace sitecing {
*/
class http_status_501 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_501(const string& m)
: http_status_5xx("501",m) { }
explicit http_status_501()
@@ -448,6 +576,9 @@ namespace sitecing {
*/
class http_status_502 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_502(const string& m)
: http_status_5xx("502",m) { }
explicit http_status_502()
@@ -458,6 +589,9 @@ namespace sitecing {
*/
class http_status_503 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_503(const string& m)
: http_status_5xx("503",m) { }
explicit http_status_503()
@@ -468,6 +602,9 @@ namespace sitecing {
*/
class http_status_504 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_504(const string& m)
: http_status_5xx("504",m) { }
explicit http_status_504()
@@ -478,6 +615,9 @@ namespace sitecing {
*/
class http_status_505 : public http_status_5xx {
public:
+ /**
+ * @param m HTTP status message
+ */
explicit http_status_505(const string& m)
: http_status_5xx("505",m) { }
explicit http_status_505()
@@ -486,55 +626,190 @@ namespace sitecing {
// Aliases
+ /**
+ * Convenience alias for informational http status exceptions
+ */
typedef http_status_1xx http_status_informational;
+ /**
+ * @see http_status_100
+ */
typedef http_status_100 http_status_continue;
+ /**
+ * @see http_status_101
+ */
typedef http_status_101 http_status_switching_protocols;
+ /**
+ * Convenience alias for success http status exceptions
+ */
typedef http_status_2xx http_status_sucessful;
+ /**
+ * @see http_status_200
+ */
typedef http_status_200 http_status_ok;
+ /**
+ * @see http_status_201
+ */
typedef http_status_201 http_status_created;
+ /**
+ * @see http_status_202
+ */
typedef http_status_202 http_status_accepted;
+ /**
+ * @see http_status_203
+ */
typedef http_status_203 http_status_non_authoritative_information;
+ /**
+ * @see http_status_204
+ */
typedef http_status_204 http_status_no_content;
+ /**
+ * @see http_status_205
+ */
typedef http_status_205 http_status_reset_content;
+ /**
+ * @see http_status_206
+ */
typedef http_status_206 http_status_partial_content;
+ /**
+ * Convenience alias for redirection http status exceptions
+ */
typedef http_status_3xx http_status_redirection;
+ /**
+ * @see http_status_200
+ */
typedef http_status_300 http_status_multiple_choices;
+ /**
+ * @see http_status_301
+ */
typedef http_status_301 http_status_moved_permanently;
+ /**
+ * @see http_status_302
+ */
typedef http_status_302 http_status_found;
+ /**
+ * @see http_status_303
+ */
typedef http_status_303 http_status_see_other;
+ /**
+ * @see http_status_304
+ */
typedef http_status_304 http_status_not_modified;
+ /**
+ * @see http_status_305
+ */
typedef http_status_305 http_status_use_proxy;
// 306 is unused and reserved
+ /**
+ * @see http_status_307
+ */
typedef http_status_307 http_status_temporary_redirect;
+ /**
+ * Convenience alias for client error http exceptions
+ */
typedef http_status_4xx http_status_client_error;
+ /**
+ * @see http_status_400
+ */
typedef http_status_400 http_status_bad_request;
+ /**
+ * @see http_status_401
+ */
typedef http_status_401 http_status_unauthorized;
+ /**
+ * @see http_status_402
+ */
typedef http_status_402 http_status_payment_required;
+ /**
+ * @see http_status_403
+ */
typedef http_status_403 http_status_forbidden;
+ /**
+ * @see http_status_404
+ */
typedef http_status_404 http_status_not_found;
+ /**
+ * @see http_status_405
+ */
typedef http_status_405 http_status_method_not_allowed;
+ /**
+ * @see http_status_406
+ */
typedef http_status_406 http_status_not_acceptable;
+ /**
+ * @see http_status_407
+ */
typedef http_status_407 http_status_proxy_authentication_required;
+ /**
+ * @see http_status_408
+ */
typedef http_status_408 http_status_request_timeout;
+ /**
+ * @see http_status_409
+ */
typedef http_status_409 http_status_conflict;
+ /**
+ * @see http_status_410
+ */
typedef http_status_410 http_status_gone;
+ /**
+ * @see http_status_411
+ */
typedef http_status_411 http_status_length_required;
+ /**
+ * @see http_status_412
+ */
typedef http_status_412 http_status_precondition_failed;
+ /**
+ * @see http_status_413
+ */
typedef http_status_413 http_status_request_entity_too_large;
+ /**
+ * @see http_status_414
+ */
typedef http_status_414 http_status_requrest_uri_too_long;
+ /**
+ * @see http_status_415
+ */
typedef http_status_415 http_status_unsupported_media_type;
+ /**
+ * @see http_status_416
+ */
typedef http_status_416 http_status_required_range_not_satisfiable;
+ /**
+ * @see http_status_417
+ */
typedef http_status_417 http_status_expectation_failed;
+ /**
+ * Convenience alias for server error http exceptions
+ */
typedef http_status_5xx http_status_server_error;
+ /**
+ * @see http_status_500
+ */
typedef http_status_500 http_status_internal_server_error;
+ /**
+ * @see http_status_501
+ */
typedef http_status_501 http_status_not_implemented;
+ /**
+ * @see http_status_502
+ */
typedef http_status_502 http_status_bad_gateway;
+ /**
+ * @see http_status_503
+ */
typedef http_status_503 http_status_service_unavailable;
+ /**
+ * @see http_status_504
+ */
typedef http_status_504 http_status_gateway_timeout;
+ /**
+ * @see http_status_505
+ */
typedef http_status_505 http_status_http_version_not_supported;
}