mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-06-25 09:33:36 +02:00
「🔨」 fix: fixed some things.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
/* Created: 2025/03/19 14:11:28 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/05/03 09:42:27 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 20:10:48 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -35,6 +35,8 @@ class Server {
|
|||||||
* @param The http error code for the page
|
* @param The http error code for the page
|
||||||
*/
|
*/
|
||||||
std::string getErrorPage(int page) {
|
std::string getErrorPage(int page) {
|
||||||
|
if (_err_pages == not_nullptr)
|
||||||
|
return "";
|
||||||
if (_err_pages->find(page) != _err_pages->end())
|
if (_err_pages->find(page) != _err_pages->end())
|
||||||
return (*_err_pages)[page];
|
return (*_err_pages)[page];
|
||||||
else
|
else
|
||||||
|
Submodule lib/tomlpp updated: 9926aa1530...9f3aa94aeb
@ -3,3 +3,4 @@ host = "0.0.0.0"
|
|||||||
port = 8090
|
port = 8090
|
||||||
|
|
||||||
[server.location./]
|
[server.location./]
|
||||||
|
methods = {"GET"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/14 12:53:54 by adjoly #+# #+# */
|
/* Created: 2025/04/14 12:53:54 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/05/03 09:42:44 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 20:36:47 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -16,6 +16,7 @@
|
|||||||
#include "node/default.hpp"
|
#include "node/default.hpp"
|
||||||
#include "webserv.hpp"
|
#include "webserv.hpp"
|
||||||
#include <config/default.hpp>
|
#include <config/default.hpp>
|
||||||
|
#include <exception>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@ -26,7 +27,9 @@ Config::Config(std::string &filename) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
file->parse();
|
file->parse();
|
||||||
} catch (std::runtime_error &e) {
|
} catch (std::exception &e) {
|
||||||
|
// if (file->getParsedFile() != not_nullptr)
|
||||||
|
// delete file->getParsedFile();
|
||||||
delete file;
|
delete file;
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
|
||||||
/* Updated: 2025/05/27 19:36:27 by adjoly ### ########.fr */
|
/* Updated: 2025/06/23 20:35:27 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -70,7 +70,9 @@ int main(int ac, char **av) {
|
|||||||
str = av[1];
|
str = av[1];
|
||||||
}
|
}
|
||||||
config::_conf = new config::Config(str);
|
config::_conf = new config::Config(str);
|
||||||
} catch (std::exception &) {
|
} catch (std::exception &e) {
|
||||||
|
Logger log;
|
||||||
|
log.error(e.what());
|
||||||
if (_log != not_nullptr)
|
if (_log != not_nullptr)
|
||||||
delete _log;
|
delete _log;
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user