🔨」 fix: fixed some things.

This commit is contained in:
adjoly
2025-06-23 20:42:50 +02:00
parent 9a1c3ee0dc
commit 340de87643
5 changed files with 14 additions and 6 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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
*/
std::string getErrorPage(int page) {
if (_err_pages == not_nullptr)
return "";
if (_err_pages->find(page) != _err_pages->end())
return (*_err_pages)[page];
else

View File

@ -3,3 +3,4 @@ host = "0.0.0.0"
port = 8090
[server.location./]
methods = {"GET"

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 "webserv.hpp"
#include <config/default.hpp>
#include <exception>
#include <netinet/in.h>
#include <stdexcept>
@ -26,7 +27,9 @@ Config::Config(std::string &filename) {
try {
file->parse();
} catch (std::runtime_error &e) {
} catch (std::exception &e) {
// if (file->getParsedFile() != not_nullptr)
// delete file->getParsedFile();
delete file;
throw e;
}

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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];
}
config::_conf = new config::Config(str);
} catch (std::exception &) {
} catch (std::exception &e) {
Logger log;
log.error(e.what());
if (_log != not_nullptr)
delete _log;
return 1;