From 3823aa73e8ee109d8a44253ac51b40c732c09f3a Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 10 Mar 2018 17:52:27 +0300 Subject: [PATCH] Fix error code. GitOrigin-RevId: b91a357cd115be02df17a141d2c7627ad1e4f4d2 --- td/telegram/TdDb.cpp | 2 +- tddb/td/db/binlog/Binlog.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/td/telegram/TdDb.cpp b/td/telegram/TdDb.cpp index 90849e9b1..c642f2d50 100644 --- a/td/telegram/TdDb.cpp +++ b/td/telegram/TdDb.cpp @@ -36,7 +36,7 @@ Result check_encryption(string path) { Binlog binlog; auto status = binlog.init(path, Binlog::Callback()); if (status.is_error() && status.code() != Binlog::Error::WrongPassword) { - return std::move(status); + return Status::Error(400, status.message()); } EncryptionInfo info; info.is_encrypted = binlog.get_info().wrong_password; diff --git a/tddb/td/db/binlog/Binlog.h b/tddb/td/db/binlog/Binlog.h index 7a286f9e1..cdda868b4 100644 --- a/tddb/td/db/binlog/Binlog.h +++ b/tddb/td/db/binlog/Binlog.h @@ -38,7 +38,7 @@ class BinlogEventsBuffer; class Binlog { public: - enum Error { WrongPassword = 1 }; + enum Error : int { WrongPassword = -1 }; static bool IGNORE_ERASE_HACK; Binlog(); Binlog(const Binlog &other) = delete;