diff --git a/common/error.h b/common/error.h index 1669c4918..79ad2c692 100644 --- a/common/error.h +++ b/common/error.h @@ -7,18 +7,18 @@ class llama_error : public std::exception { private: - std::string _id; - std::string _description; + std::string _type; + std::string _message; public: - llama_error(const std::string & id, const std::string & description) + llama_error(const std::string & type, const std::string & message) : - _id(id), - _description(description) + _type(type), + _message(message) { - fprintf(stderr, "ERROR [%s]: %s\n", id.c_str(), description.c_str()); + fprintf(stderr, "ERROR [%s]: %s\n", type.c_str(), message.c_str()); } - inline const std::string & id() const { return _id; } - inline const std::string & description() const { return _description; } + inline const std::string & type() const { return _type; } + inline const std::string & message() const { return _message; } }; diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 06707bb51..88661a944 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1215,15 +1215,15 @@ struct server_context { { return { { "error", { - { "id", error.id() }, - { "description", error.description() } + { "type", error.type() }, + { "message", error.message() } } } }; } void send_error(const server_task & task, const llama_error& error) { - LOG_TEE("task %i - error: %s - %s\n", task.id, error.id().c_str(), error.description().c_str()); + LOG_TEE("task %i - error: %s - %s\n", task.id, error.type().c_str(), error.message().c_str()); server_task_result res; res.id = task.id; res.id_multi = task.id_multi;