From a17abc55573d1026533219567b3714a5298afdc9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Nov 2016 12:52:39 +0100 Subject: [PATCH] Log: remove the obsolete class Error overloads --- src/Log.cxx | 33 --------------------------------- src/Log.hxx | 11 ----------- 2 files changed, 44 deletions(-) diff --git a/src/Log.cxx b/src/Log.cxx index 836ddcdc7..330ac4bc0 100644 --- a/src/Log.cxx +++ b/src/Log.cxx @@ -98,8 +98,6 @@ LogError(const std::exception &e) std::rethrow_if_nested(e); } catch (const std::exception &nested) { LogError(nested, "nested"); - } catch (const Error &nested) { - LogError(nested, "nested"); } catch (...) { Log(exception_domain, LogLevel::ERROR, "Unrecognized nested exception"); @@ -115,8 +113,6 @@ LogError(const std::exception &e, const char *msg) std::rethrow_if_nested(e); } catch (const std::exception &nested) { LogError(nested); - } catch (const Error &nested) { - LogError(nested); } catch (...) { Log(exception_domain, LogLevel::ERROR, "Unrecognized nested exception"); @@ -142,8 +138,6 @@ LogError(const std::exception_ptr &ep) std::rethrow_exception(ep); } catch (const std::exception &e) { LogError(e); - } catch (const Error &e) { - LogError(e); } catch (...) { Log(exception_domain, LogLevel::ERROR, "Unrecognized exception"); @@ -157,8 +151,6 @@ LogError(const std::exception_ptr &ep, const char *msg) std::rethrow_exception(ep); } catch (const std::exception &e) { LogError(e, msg); - } catch (const Error &e) { - LogError(e, msg); } catch (...) { FormatError(exception_domain, "%s: Unrecognized exception", msg); @@ -177,31 +169,6 @@ FormatError(const std::exception_ptr &ep, const char *fmt, ...) LogError(ep, msg); } -void -LogError(const Error &error) -{ - Log(error.GetDomain(), LogLevel::ERROR, error.GetMessage()); -} - -void -LogError(const Error &error, const char *msg) -{ - LogFormat(error.GetDomain(), LogLevel::ERROR, "%s: %s", - msg, error.GetMessage()); -} - -void -FormatError(const Error &error, const char *fmt, ...) -{ - char msg[1024]; - va_list ap; - va_start(ap, fmt); - vsnprintf(msg, sizeof(msg), fmt, ap); - va_end(ap); - - LogError(error, msg); -} - void LogErrno(const Domain &domain, int e, const char *msg) { diff --git a/src/Log.hxx b/src/Log.hxx index 78489f22d..dee338284 100644 --- a/src/Log.hxx +++ b/src/Log.hxx @@ -25,7 +25,6 @@ #include -class Error; class Domain; void @@ -105,16 +104,6 @@ gcc_printf(2,3) void FormatError(const Domain &domain, const char *fmt, ...); -void -LogError(const Error &error); - -void -LogError(const Error &error, const char *msg); - -gcc_printf(2,3) -void -FormatError(const Error &error, const char *fmt, ...); - void LogErrno(const Domain &domain, int e, const char *msg);