Error handling only needs last error.
This commit is contained in:
parent
c188630590
commit
a827b11d86
@ -19,15 +19,14 @@
|
||||
#include "neocomm.h"
|
||||
#include "error.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
static std::vector<std::string> 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user