From f20eb0b72c0b54730a710a81d89e4d73a86af99c Mon Sep 17 00:00:00 2001 From: Roman Tsisyk <roman@tsisyk.com> Date: Mon, 14 Oct 2013 13:34:01 +0400 Subject: [PATCH] Fix #62: "Log actual file name and line number on exceptions" --- src/exception.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/exception.cc b/src/exception.cc index 95579cbcf7..55b04f8bad 100644 --- a/src/exception.cc +++ b/src/exception.cc @@ -70,10 +70,11 @@ SystemError::init(const char *format, va_list ap) void SystemError::log() const { - say(S_ERROR, strerror(m_errnum), "%s in %s", "SystemError", - m_errmsg); + _say(S_ERROR, m_file, m_line, strerror(m_errnum), "SystemError %s", + m_errmsg); } + ClientError::ClientError(const char *file, unsigned line, uint32_t errcode, ...) : Exception(file, line) { @@ -98,8 +99,8 @@ ClientError::ClientError(const char *file, unsigned line, const char *msg, void ClientError::log() const { - say_error("%s at %s:%d, %s", "ClientError", - m_file, m_line, m_errmsg); + _say(S_ERROR, m_file, m_line, NULL, "%s: %s", tnt_errcode_str(m_errcode), + m_errmsg); } IllegalParams::IllegalParams(const char *file, unsigned line, const char *msg) -- GitLab