ajout des prints erreur

This commit is contained in:
Yannis Antoine
2025-03-07 16:14:43 +01:00
parent fb27cad32e
commit b5ea2bc794
4 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -6,7 +6,7 @@
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/14 01:41:17 by yantoine #+# #+# */
/* Updated: 2025/03/05 17:54:38 by yantoine ### ########.fr */
/* Updated: 2025/03/07 16:10:31 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
@@ -50,7 +50,7 @@ static char **get_all_file(int fd)
if (count > MAX_SPHERES + MAX_PLANES + MAX_CYLINDERS + MAX_LIGHTS + MAX_AMBIENT + MAX_CAMERA)
{
free(join);
ft_putstr_fd("erreur: max element reached\n", 2);
ft_putstr_fd("Erreur:\n max element reached\n", 2);
close(fd);
exit(1);
}
@@ -95,6 +95,7 @@ t_scene load_config(const char *filename)
if (!check_nb_element(scene))
{
ft_free_array(scene.all_file);
ft_putstr_fd("Error\n Bad number element\n", 2);
exit(1);
}
scene = parsing_line(line, scene);
+2 -2
View File
@@ -6,7 +6,7 @@
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/14 20:05:49 by yantoine #+# #+# */
/* Updated: 2025/02/25 19:38:13 by yantoine ### ########.fr */
/* Updated: 2025/03/07 16:11:53 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
@@ -36,7 +36,7 @@ t_vec3 parse_color(const char *token, t_scene scene)
{
ft_free_array(token_color);
ft_free_array(scene.token_if_exit);
ft_putendl_fd("error", 2);
ft_putendl_fd("Error\nToken or range are bad\n", 2);
ft_free_array(scene.all_file);
close(scene.fd_if_exit);
exit(1);
+2 -2
View File
@@ -6,7 +6,7 @@
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/14 20:23:21 by yantoine #+# #+# */
/* Updated: 2025/02/25 19:37:18 by yantoine ### ########.fr */
/* Updated: 2025/03/07 16:12:25 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,7 +22,7 @@ char **get_tokens_secure(t_scene scene, const int numObject,
if (!check_tokens(tokens, supposed_nb_token) || !isdigit_token(tokens + 1))
{
ft_free_array(tokens);
ft_putendl_fd("error", 2);
ft_putendl_fd("Error\nTokens are bad\n", 2);
ft_free_array(scene.all_file);
close(scene.fd_if_exit);
exit(1);
+2 -2
View File
@@ -6,7 +6,7 @@
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/15 19:16:01 by yantoine #+# #+# */
/* Updated: 2025/02/25 19:37:48 by yantoine ### ########.fr */
/* Updated: 2025/03/07 16:12:57 by yantoine ### ########.fr */
/* */
/* ************************************************************************** */
@@ -37,7 +37,7 @@ t_vec3 parse_vector(const char *token, t_scene scene)
{
ft_free_array(token_vector);
ft_free_array(scene.token_if_exit);
ft_putendl_fd("error", 2);
ft_putendl_fd("Error\nBad Tokens", 2);
ft_free_array(scene.all_file);
close(scene.fd_if_exit);
exit(1);