-rw-r--r-- | include/sitecing/exception.h | 275 |
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 | |||
@@ -45,2 +45,6 @@ namespace sitecing { | |||
45 | public: | 45 | public: |
46 | /** | ||
47 | * @param s HTTP status | ||
48 | * @param m HTTP status message | ||
49 | */ | ||
46 | explicit http_status_1xx(const string &s,const string& m) | 50 | explicit http_status_1xx(const string &s,const string& m) |
@@ -53,2 +57,5 @@ namespace sitecing { | |||
53 | public: | 57 | public: |
58 | /** | ||
59 | * @param m HTTP status message | ||
60 | */ | ||
54 | explicit http_status_100(const string& m) | 61 | explicit http_status_100(const string& m) |
@@ -63,2 +70,5 @@ namespace sitecing { | |||
63 | public: | 70 | public: |
71 | /** | ||
72 | * @param m HTTP status message | ||
73 | */ | ||
64 | explicit http_status_101(const string& m) | 74 | explicit http_status_101(const string& m) |
@@ -74,2 +84,6 @@ namespace sitecing { | |||
74 | public: | 84 | public: |
85 | /** | ||
86 | * @param s HTTP status message | ||
87 | * @param m HTTP status message | ||
88 | */ | ||
75 | explicit http_status_2xx(const string& s,const string& m) | 89 | explicit http_status_2xx(const string& s,const string& m) |
@@ -82,2 +96,5 @@ namespace sitecing { | |||
82 | public: | 96 | public: |
97 | /** | ||
98 | * @param m HTTP status message | ||
99 | */ | ||
83 | explicit http_status_200(const string& m) | 100 | explicit http_status_200(const string& m) |
@@ -92,2 +109,5 @@ namespace sitecing { | |||
92 | public: | 109 | public: |
110 | /** | ||
111 | * @param m HTTP status message | ||
112 | */ | ||
93 | explicit http_status_201(const string& m) | 113 | explicit http_status_201(const string& m) |
@@ -102,2 +122,5 @@ namespace sitecing { | |||
102 | public: | 122 | public: |
123 | /** | ||
124 | * @param m HTTP status message | ||
125 | */ | ||
103 | explicit http_status_202(const string& m) | 126 | explicit http_status_202(const string& m) |
@@ -112,2 +135,5 @@ namespace sitecing { | |||
112 | public: | 135 | public: |
136 | /** | ||
137 | * @param m HTTP status message | ||
138 | */ | ||
113 | explicit http_status_203(const string& m) | 139 | explicit http_status_203(const string& m) |
@@ -122,2 +148,5 @@ namespace sitecing { | |||
122 | public: | 148 | public: |
149 | /** | ||
150 | * @param m HTTP status message | ||
151 | */ | ||
123 | explicit http_status_204(const string& m) | 152 | explicit http_status_204(const string& m) |
@@ -132,2 +161,5 @@ namespace sitecing { | |||
132 | public: | 161 | public: |
162 | /** | ||
163 | * @param m HTTP status message | ||
164 | */ | ||
133 | explicit http_status_205(const string& m) | 165 | explicit http_status_205(const string& m) |
@@ -142,2 +174,5 @@ namespace sitecing { | |||
142 | public: | 174 | public: |
175 | /** | ||
176 | * @param m HTTP status message | ||
177 | */ | ||
143 | explicit http_status_206(const string& m) | 178 | explicit http_status_206(const string& m) |
@@ -153,2 +188,6 @@ namespace sitecing { | |||
153 | public: | 188 | public: |
189 | /** | ||
190 | * @param s HTTP status | ||
191 | * @param m HTTP status message | ||
192 | */ | ||
154 | explicit http_status_3xx(const string& s,const string& m) | 193 | explicit http_status_3xx(const string& s,const string& m) |
@@ -161,2 +200,5 @@ namespace sitecing { | |||
161 | public: | 200 | public: |
201 | /** | ||
202 | * @param m HTTP status message | ||
203 | */ | ||
162 | explicit http_status_300(const string& m) | 204 | explicit http_status_300(const string& m) |
@@ -171,2 +213,5 @@ namespace sitecing { | |||
171 | public: | 213 | public: |
214 | /** | ||
215 | * @param m HTTP status message | ||
216 | */ | ||
172 | explicit http_status_301(const string& m) | 217 | explicit http_status_301(const string& m) |
@@ -181,2 +226,5 @@ namespace sitecing { | |||
181 | public: | 226 | public: |
227 | /** | ||
228 | * @param m HTTP status message | ||
229 | */ | ||
182 | explicit http_status_302(const string& m) | 230 | explicit http_status_302(const string& m) |
@@ -191,2 +239,5 @@ namespace sitecing { | |||
191 | public: | 239 | public: |
240 | /** | ||
241 | * @param m HTTP status message | ||
242 | */ | ||
192 | explicit http_status_303(const string& m) | 243 | explicit http_status_303(const string& m) |
@@ -201,2 +252,5 @@ namespace sitecing { | |||
201 | public: | 252 | public: |
253 | /** | ||
254 | * @param m HTTP status message | ||
255 | */ | ||
202 | explicit http_status_304(const string& m) | 256 | explicit http_status_304(const string& m) |
@@ -211,2 +265,5 @@ namespace sitecing { | |||
211 | public: | 265 | public: |
266 | /** | ||
267 | * @param m HTTP status message | ||
268 | */ | ||
212 | explicit http_status_305(const string& m) | 269 | explicit http_status_305(const string& m) |
@@ -222,2 +279,5 @@ namespace sitecing { | |||
222 | public: | 279 | public: |
280 | /** | ||
281 | * @param m HTTP status message | ||
282 | */ | ||
223 | explicit http_status_307(const string& m) | 283 | explicit http_status_307(const string& m) |
@@ -233,2 +293,6 @@ namespace sitecing { | |||
233 | public: | 293 | public: |
294 | /** | ||
295 | * @param s HTTP status | ||
296 | * @param m HTTP status message | ||
297 | */ | ||
234 | explicit http_status_4xx(const string& s,const string& m) | 298 | explicit http_status_4xx(const string& s,const string& m) |
@@ -241,2 +305,5 @@ namespace sitecing { | |||
241 | public: | 305 | public: |
306 | /** | ||
307 | * @param m HTTP status message | ||
308 | */ | ||
242 | explicit http_status_400(const string& m) | 309 | explicit http_status_400(const string& m) |
@@ -251,2 +318,5 @@ namespace sitecing { | |||
251 | public: | 318 | public: |
319 | /** | ||
320 | * @param m HTTP status message | ||
321 | */ | ||
252 | explicit http_status_401(const string& m) | 322 | explicit http_status_401(const string& m) |
@@ -261,2 +331,5 @@ namespace sitecing { | |||
261 | public: | 331 | public: |
332 | /** | ||
333 | * @param m HTTP status message | ||
334 | */ | ||
262 | explicit http_status_402(const string& m) | 335 | explicit http_status_402(const string& m) |
@@ -271,2 +344,5 @@ namespace sitecing { | |||
271 | public: | 344 | public: |
345 | /** | ||
346 | * @param m HTTP status message | ||
347 | */ | ||
272 | explicit http_status_403(const string& m) | 348 | explicit http_status_403(const string& m) |
@@ -281,2 +357,5 @@ namespace sitecing { | |||
281 | public: | 357 | public: |
358 | /** | ||
359 | * @param m HTTP status message | ||
360 | */ | ||
282 | explicit http_status_404(const string& m) | 361 | explicit http_status_404(const string& m) |
@@ -291,2 +370,5 @@ namespace sitecing { | |||
291 | public: | 370 | public: |
371 | /** | ||
372 | * @param m HTTP status message | ||
373 | */ | ||
292 | explicit http_status_405(const string& m) | 374 | explicit http_status_405(const string& m) |
@@ -301,2 +383,5 @@ namespace sitecing { | |||
301 | public: | 383 | public: |
384 | /** | ||
385 | * @param m HTTP status message | ||
386 | */ | ||
302 | explicit http_status_406(const string& m) | 387 | explicit http_status_406(const string& m) |
@@ -311,2 +396,5 @@ namespace sitecing { | |||
311 | public: | 396 | public: |
397 | /** | ||
398 | * @param m HTTP status message | ||
399 | */ | ||
312 | explicit http_status_407(const string& m) | 400 | explicit http_status_407(const string& m) |
@@ -321,2 +409,5 @@ namespace sitecing { | |||
321 | public: | 409 | public: |
410 | /** | ||
411 | * @param m HTTP status message | ||
412 | */ | ||
322 | explicit http_status_408(const string& m) | 413 | explicit http_status_408(const string& m) |
@@ -331,2 +422,5 @@ namespace sitecing { | |||
331 | public: | 422 | public: |
423 | /** | ||
424 | * @param m HTTP status message | ||
425 | */ | ||
332 | explicit http_status_409(const string& m) | 426 | explicit http_status_409(const string& m) |
@@ -341,2 +435,5 @@ namespace sitecing { | |||
341 | public: | 435 | public: |
436 | /** | ||
437 | * @param m HTTP status message | ||
438 | */ | ||
342 | explicit http_status_410(const string& m) | 439 | explicit http_status_410(const string& m) |
@@ -351,2 +448,5 @@ namespace sitecing { | |||
351 | public: | 448 | public: |
449 | /** | ||
450 | * @param m HTTP status message | ||
451 | */ | ||
352 | explicit http_status_411(const string& m) | 452 | explicit http_status_411(const string& m) |
@@ -361,2 +461,5 @@ namespace sitecing { | |||
361 | public: | 461 | public: |
462 | /** | ||
463 | * @param m HTTP status message | ||
464 | */ | ||
362 | explicit http_status_412(const string& m) | 465 | explicit http_status_412(const string& m) |
@@ -371,2 +474,5 @@ namespace sitecing { | |||
371 | public: | 474 | public: |
475 | /** | ||
476 | * @param m HTTP status message | ||
477 | */ | ||
372 | explicit http_status_413(const string& m) | 478 | explicit http_status_413(const string& m) |
@@ -381,2 +487,5 @@ namespace sitecing { | |||
381 | public: | 487 | public: |
488 | /** | ||
489 | * @param m HTTP status message | ||
490 | */ | ||
382 | explicit http_status_414(const string& m) | 491 | explicit http_status_414(const string& m) |
@@ -391,2 +500,5 @@ namespace sitecing { | |||
391 | public: | 500 | public: |
501 | /** | ||
502 | * @param m HTTP status message | ||
503 | */ | ||
392 | explicit http_status_415(const string& m) | 504 | explicit http_status_415(const string& m) |
@@ -401,2 +513,5 @@ namespace sitecing { | |||
401 | public: | 513 | public: |
514 | /** | ||
515 | * @param m HTTP status message | ||
516 | */ | ||
402 | explicit http_status_416(const string& m) | 517 | explicit http_status_416(const string& m) |
@@ -411,2 +526,5 @@ namespace sitecing { | |||
411 | public: | 526 | public: |
527 | /** | ||
528 | * @param m HTTP status message | ||
529 | */ | ||
412 | explicit http_status_417(const string& m) | 530 | explicit http_status_417(const string& m) |
@@ -422,2 +540,6 @@ namespace sitecing { | |||
422 | public: | 540 | public: |
541 | /** | ||
542 | * @param s HTTP status | ||
543 | * @param m HTTP status message | ||
544 | */ | ||
423 | explicit http_status_5xx(const string& s,const string& m) | 545 | explicit http_status_5xx(const string& s,const string& m) |
@@ -430,2 +552,5 @@ namespace sitecing { | |||
430 | public: | 552 | public: |
553 | /** | ||
554 | * @param m HTTP status message | ||
555 | */ | ||
431 | explicit http_status_500(const string& m) | 556 | explicit http_status_500(const string& m) |
@@ -440,2 +565,5 @@ namespace sitecing { | |||
440 | public: | 565 | public: |
566 | /** | ||
567 | * @param m HTTP status message | ||
568 | */ | ||
441 | explicit http_status_501(const string& m) | 569 | explicit http_status_501(const string& m) |
@@ -450,2 +578,5 @@ namespace sitecing { | |||
450 | public: | 578 | public: |
579 | /** | ||
580 | * @param m HTTP status message | ||
581 | */ | ||
451 | explicit http_status_502(const string& m) | 582 | explicit http_status_502(const string& m) |
@@ -460,2 +591,5 @@ namespace sitecing { | |||
460 | public: | 591 | public: |
592 | /** | ||
593 | * @param m HTTP status message | ||
594 | */ | ||
461 | explicit http_status_503(const string& m) | 595 | explicit http_status_503(const string& m) |
@@ -470,2 +604,5 @@ namespace sitecing { | |||
470 | public: | 604 | public: |
605 | /** | ||
606 | * @param m HTTP status message | ||
607 | */ | ||
471 | explicit http_status_504(const string& m) | 608 | explicit http_status_504(const string& m) |
@@ -480,2 +617,5 @@ namespace sitecing { | |||
480 | public: | 617 | public: |
618 | /** | ||
619 | * @param m HTTP status message | ||
620 | */ | ||
481 | explicit http_status_505(const string& m) | 621 | explicit http_status_505(const string& m) |
@@ -488,51 +628,186 @@ namespace sitecing { | |||
488 | 628 | ||
629 | /** | ||
630 | * Convenience alias for informational http status exceptions | ||
631 | */ | ||
489 | typedef http_status_1xx http_status_informational; | 632 | typedef http_status_1xx http_status_informational; |
633 | /** | ||
634 | * @see http_status_100 | ||
635 | */ | ||
490 | typedef http_status_100 http_status_continue; | 636 | typedef http_status_100 http_status_continue; |
637 | /** | ||
638 | * @see http_status_101 | ||
639 | */ | ||
491 | typedef http_status_101 http_status_switching_protocols; | 640 | typedef http_status_101 http_status_switching_protocols; |
492 | 641 | ||
642 | /** | ||
643 | * Convenience alias for success http status exceptions | ||
644 | */ | ||
493 | typedef http_status_2xx http_status_sucessful; | 645 | typedef http_status_2xx http_status_sucessful; |
646 | /** | ||
647 | * @see http_status_200 | ||
648 | */ | ||
494 | typedef http_status_200 http_status_ok; | 649 | typedef http_status_200 http_status_ok; |
650 | /** | ||
651 | * @see http_status_201 | ||
652 | */ | ||
495 | typedef http_status_201 http_status_created; | 653 | typedef http_status_201 http_status_created; |
654 | /** | ||
655 | * @see http_status_202 | ||
656 | */ | ||
496 | typedef http_status_202 http_status_accepted; | 657 | typedef http_status_202 http_status_accepted; |
658 | /** | ||
659 | * @see http_status_203 | ||
660 | */ | ||
497 | typedef http_status_203 http_status_non_authoritative_information; | 661 | typedef http_status_203 http_status_non_authoritative_information; |
662 | /** | ||
663 | * @see http_status_204 | ||
664 | */ | ||
498 | typedef http_status_204 http_status_no_content; | 665 | typedef http_status_204 http_status_no_content; |
666 | /** | ||
667 | * @see http_status_205 | ||
668 | */ | ||
499 | typedef http_status_205 http_status_reset_content; | 669 | typedef http_status_205 http_status_reset_content; |
670 | /** | ||
671 | * @see http_status_206 | ||
672 | */ | ||
500 | typedef http_status_206 http_status_partial_content; | 673 | typedef http_status_206 http_status_partial_content; |
501 | 674 | ||
675 | /** | ||
676 | * Convenience alias for redirection http status exceptions | ||
677 | */ | ||
502 | typedef http_status_3xx http_status_redirection; | 678 | typedef http_status_3xx http_status_redirection; |
679 | /** | ||
680 | * @see http_status_200 | ||
681 | */ | ||
503 | typedef http_status_300 http_status_multiple_choices; | 682 | typedef http_status_300 http_status_multiple_choices; |
683 | /** | ||
684 | * @see http_status_301 | ||
685 | */ | ||
504 | typedef http_status_301 http_status_moved_permanently; | 686 | typedef http_status_301 http_status_moved_permanently; |
687 | /** | ||
688 | * @see http_status_302 | ||
689 | */ | ||
505 | typedef http_status_302 http_status_found; | 690 | typedef http_status_302 http_status_found; |
691 | /** | ||
692 | * @see http_status_303 | ||
693 | */ | ||
506 | typedef http_status_303 http_status_see_other; | 694 | typedef http_status_303 http_status_see_other; |
695 | /** | ||
696 | * @see http_status_304 | ||
697 | */ | ||
507 | typedef http_status_304 http_status_not_modified; | 698 | typedef http_status_304 http_status_not_modified; |
699 | /** | ||
700 | * @see http_status_305 | ||
701 | */ | ||
508 | typedef http_status_305 http_status_use_proxy; | 702 | typedef http_status_305 http_status_use_proxy; |
509 | // 306 is unused and reserved | 703 | // 306 is unused and reserved |
704 | /** | ||
705 | * @see http_status_307 | ||
706 | */ | ||
510 | typedef http_status_307 http_status_temporary_redirect; | 707 | typedef http_status_307 http_status_temporary_redirect; |
511 | 708 | ||
709 | /** | ||
710 | * Convenience alias for client error http exceptions | ||
711 | */ | ||
512 | typedef http_status_4xx http_status_client_error; | 712 | typedef http_status_4xx http_status_client_error; |
713 | /** | ||
714 | * @see http_status_400 | ||
715 | */ | ||
513 | typedef http_status_400 http_status_bad_request; | 716 | typedef http_status_400 http_status_bad_request; |
717 | /** | ||
718 | * @see http_status_401 | ||
719 | */ | ||
514 | typedef http_status_401 http_status_unauthorized; | 720 | typedef http_status_401 http_status_unauthorized; |
721 | /** | ||
722 | * @see http_status_402 | ||
723 | */ | ||
515 | typedef http_status_402 http_status_payment_required; | 724 | typedef http_status_402 http_status_payment_required; |
725 | /** | ||
726 | * @see http_status_403 | ||
727 | */ | ||
516 | typedef http_status_403 http_status_forbidden; | 728 | typedef http_status_403 http_status_forbidden; |
729 | /** | ||
730 | * @see http_status_404 | ||
731 | */ | ||
517 | typedef http_status_404 http_status_not_found; | 732 | typedef http_status_404 http_status_not_found; |
733 | /** | ||
734 | * @see http_status_405 | ||
735 | */ | ||
518 | typedef http_status_405 http_status_method_not_allowed; | 736 | typedef http_status_405 http_status_method_not_allowed; |
737 | /** | ||
738 | * @see http_status_406 | ||
739 | */ | ||
519 | typedef http_status_406 http_status_not_acceptable; | 740 | typedef http_status_406 http_status_not_acceptable; |
741 | /** | ||
742 | * @see http_status_407 | ||
743 | */ | ||
520 | typedef http_status_407 http_status_proxy_authentication_required; | 744 | typedef http_status_407 http_status_proxy_authentication_required; |
745 | /** | ||
746 | * @see http_status_408 | ||
747 | */ | ||
521 | typedef http_status_408 http_status_request_timeout; | 748 | typedef http_status_408 http_status_request_timeout; |
749 | /** | ||
750 | * @see http_status_409 | ||
751 | */ | ||
522 | typedef http_status_409 http_status_conflict; | 752 | typedef http_status_409 http_status_conflict; |
753 | /** | ||
754 | * @see http_status_410 | ||
755 | */ | ||
523 | typedef http_status_410 http_status_gone; | 756 | typedef http_status_410 http_status_gone; |
757 | /** | ||
758 | * @see http_status_411 | ||
759 | */ | ||
524 | typedef http_status_411 http_status_length_required; | 760 | typedef http_status_411 http_status_length_required; |
761 | /** | ||
762 | * @see http_status_412 | ||
763 | */ | ||
525 | typedef http_status_412 http_status_precondition_failed; | 764 | typedef http_status_412 http_status_precondition_failed; |
765 | /** | ||
766 | * @see http_status_413 | ||
767 | */ | ||
526 | typedef http_status_413 http_status_request_entity_too_large; | 768 | typedef http_status_413 http_status_request_entity_too_large; |
769 | /** | ||
770 | * @see http_status_414 | ||
771 | */ | ||
527 | typedef http_status_414 http_status_requrest_uri_too_long; | 772 | typedef http_status_414 http_status_requrest_uri_too_long; |
773 | /** | ||
774 | * @see http_status_415 | ||
775 | */ | ||
528 | typedef http_status_415 http_status_unsupported_media_type; | 776 | typedef http_status_415 http_status_unsupported_media_type; |
777 | /** | ||
778 | * @see http_status_416 | ||
779 | */ | ||
529 | typedef http_status_416 http_status_required_range_not_satisfiable; | 780 | typedef http_status_416 http_status_required_range_not_satisfiable; |
781 | /** | ||
782 | * @see http_status_417 | ||
783 | */ | ||
530 | typedef http_status_417 http_status_expectation_failed; | 784 | typedef http_status_417 http_status_expectation_failed; |
531 | 785 | ||
786 | /** | ||
787 | * Convenience alias for server error http exceptions | ||
788 | */ | ||
532 | typedef http_status_5xx http_status_server_error; | 789 | typedef http_status_5xx http_status_server_error; |
790 | /** | ||
791 | * @see http_status_500 | ||
792 | */ | ||
533 | typedef http_status_500 http_status_internal_server_error; | 793 | typedef http_status_500 http_status_internal_server_error; |
794 | /** | ||
795 | * @see http_status_501 | ||
796 | */ | ||
534 | typedef http_status_501 http_status_not_implemented; | 797 | typedef http_status_501 http_status_not_implemented; |
798 | /** | ||
799 | * @see http_status_502 | ||
800 | */ | ||
535 | typedef http_status_502 http_status_bad_gateway; | 801 | typedef http_status_502 http_status_bad_gateway; |
802 | /** | ||
803 | * @see http_status_503 | ||
804 | */ | ||
536 | typedef http_status_503 http_status_service_unavailable; | 805 | typedef http_status_503 http_status_service_unavailable; |
806 | /** | ||
807 | * @see http_status_504 | ||
808 | */ | ||
537 | typedef http_status_504 http_status_gateway_timeout; | 809 | typedef http_status_504 http_status_gateway_timeout; |
810 | /** | ||
811 | * @see http_status_505 | ||
812 | */ | ||
538 | typedef http_status_505 http_status_http_version_not_supported; | 813 | typedef http_status_505 http_status_http_version_not_supported; |