From e37eb0aa542ef8aee8532c5bfdde7f09ed343a28 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 21 Mar 2019 16:42:52 -0700 Subject: More cleanup of old stuff no longer used. --- ext/librethinkdbxx/src/error.h | 46 ------------------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 ext/librethinkdbxx/src/error.h (limited to 'ext/librethinkdbxx/src/error.h') diff --git a/ext/librethinkdbxx/src/error.h b/ext/librethinkdbxx/src/error.h deleted file mode 100644 index ab75e248..00000000 --- a/ext/librethinkdbxx/src/error.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace RethinkDB { - -// All errors thrown by the server have this type -struct Error { - template - explicit Error(const char* format_, T... A) { - format(format_, A...); - } - - Error() = default; - Error(Error&&) = default; - Error(const Error&) = default; - - Error& operator= (Error&& other) { - message = std::move(other.message); - return *this; - } - - static Error from_errno(const char* str){ - return Error("%s: %s", str, strerror(errno)); - } - - // The error message - std::string message; - -private: - const size_t max_message_size = 2048; - - void format(const char* format_, ...) { - va_list args; - va_start(args, format_); - char message_[max_message_size]; - vsnprintf(message_, max_message_size, format_, args); - va_end(args); - message = message_; - } -}; - -} -- cgit v1.2.3