File tree Expand file tree Collapse file tree 2 files changed +2
-22
lines changed
Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ webserver::http_endpoint::http_endpoint
9292 }
9393
9494 if ((parts[i].size () < 3 ) || (parts[i][0 ] != ' {' ) || (parts[i][parts[i].size () - 1 ] != ' }' ))
95- throw webserver::http_endpoint::bad_http_endpoint ( );
95+ throw std::invalid_argument ( " Bad URL format " );
9696
9797 std::string::size_type bar = parts[i].find_first_of (' |' );
9898 this ->url_pars .push_back (parts[i].substr (1 , bar != string::npos ? bar - 1 : parts[i].size () - 2 ));
Original file line number Diff line number Diff line change 2929#include < utility>
3030#include < regex.h>
3131#include < string>
32+ #include < stdexcept>
3233
3334#include " webserver.hpp"
3435
@@ -38,33 +39,12 @@ namespace httpserver
3839class webserver ;
3940class http_resource ;
4041
41- namespace details
42- {
43-
44- /* *
45- * Exception class throwed when a bad formatted http url is used
46- **/
47-
48- };
49-
5042/* *
5143 * Class representing an Http Endpoint. It is an abstraction used by the APIs.
5244**/
5345class webserver ::http_endpoint
5446{
5547 public:
56- class bad_http_endpoint : public std ::exception
57- {
58- /* *
59- * Method used to see error details
60- * @return a const char* containing the error message
61- **/
62- virtual const char * what () const throw()
63- {
64- return " Bad url format!" ;
65- }
66- };
67-
6848 /* *
6949 * Copy constructor. It is useful expecially to copy regex_t structure that contains dinamically allocated data.
7050 * @param h The http_endpoint to copy
You can’t perform that action at this time.
0 commit comments