diff --git a/player_code/cpp/Makefile b/player_code/cpp/Makefile index cbd382b..504f358 100644 --- a/player_code/cpp/Makefile +++ b/player_code/cpp/Makefile @@ -1,6 +1,6 @@ EXE=run CXX=g++ -FLAGS=-std=c++20 -O2 -static +FLAGS=-std=c++20 -O2 -static -fdiagnostics-color=always all: $(EXE) @@ -14,7 +14,7 @@ main.o: main.cpp player_code.h $(CXX) $(FLAGS) -c -o main.o main.cpp $(EXE): $(EXE).o player_code.o main.o - g++ -static -o $(EXE) $(EXE).o player_code.o main.o + g++ -fdiagnostics-color=always -static -o $(EXE) $(EXE).o player_code.o main.o clean_objects: rm player_code.o $(EXE).o main.o diff --git a/src/lib.rs b/src/lib.rs index 72bd7c8..c81790b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,6 +192,14 @@ pub fn create_error_response( } SimulatorError::TimeOutError(e) => ("Timeout Error!".to_owned(), e), }; + + let error = error + .lines() + .into_iter() + .map(|x| format!("ERRORS, {}", x)) + .collect::>() + .join("\n"); + response::GameStatus { game_id: game_request.game_id.clone(), game_status: response::GameStatusEnum::EXECUTE_ERROR, @@ -200,8 +208,8 @@ pub fn create_error_response( coins_used: 0, has_errors: true, log: format!( - "ERROR TYPE: {}\n\nERROR LOG\n{}\nERROR TYPE : {}\n", - err_type, error, err_type + "ERRORS, ERROR TYPE: {}\nERRORS, ERROR LOG:\n{}\n", + err_type, error ), }), }