Fix error code.

GitOrigin-RevId: b91a357cd115be02df17a141d2c7627ad1e4f4d2
This commit is contained in:
levlam 2018-03-10 17:52:27 +03:00
parent 96f720063a
commit 3823aa73e8
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ Result<EncryptionInfo> 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;

View File

@ -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;