From a827b11d86043dac277407ee7165d8d9e03ff9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Mon, 25 Sep 2017 15:59:23 +0200 Subject: [PATCH] Error handling only needs last error. --- src/error.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index fc85bf2..9068df6 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -19,15 +19,14 @@ #include "neocomm.h" #include "error.hpp" -#include +#include -static std::vector errors; +static std::string last_error; void add_error(const std::string &error) { - if(not errors.empty()) - errors.push_back(error); + last_error = error; } const char *NeoComm_get_last_error() { - return errors.back().c_str(); + return last_error.c_str(); }