sapling/eden/fs/rocksdb/RocksException.h
Keith Birney 1207f3b780 Remove no-longer-needed @manual for rocksdb
Summary:
Now that T21504968 is closed, manual tags are no longer needed for rocksdb includes
Diff prepared using
```lang=bash
fbgs -s manual=@/rocksdb -l | xargs sed -i 's# // manual=@/rocksdb:rocksdb##'
find adsatlas -name TARGETS | xargs parallel -j 24 autodeps :::
find eden/fs/rocksdb -name TARGETS | xargs parallel -j 24 autodeps :::
find eden/fs/store -name TARGETS | xargs parallel -j 24 autodeps :::
find insights -name TARGETS | grep -v "^insights/cocoon/" | xargs parallel -j 24 autodeps :::
```

Reviewed By: yfeldblum, meyering

Differential Revision: D5760964

fbshipit-source-id: ea75c14c521cd7d4eb9d004ca31d7c1f89941f4c
2017-09-01 19:31:46 -07:00

46 lines
1.1 KiB
C++

/*
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once
#include <folly/String.h>
#include <rocksdb/db.h>
namespace facebook {
namespace eden {
class RocksException : public std::exception {
public:
RocksException(const rocksdb::Status& status, const std::string& msg);
template <typename... Args>
static RocksException build(const rocksdb::Status& status, Args&&... args) {
return RocksException(
status, folly::to<std::string>(std::forward<Args>(args)...));
}
template <typename... Args>
static void check(const rocksdb::Status& status, Args&&... args) {
if (UNLIKELY(!status.ok())) {
throw build(status, std::forward<Args>(args)...);
}
}
const char* what() const noexcept override;
const rocksdb::Status& getStatus() const;
const std::string& getMsg() const;
private:
rocksdb::Status status_;
std::string msg_;
std::string fullMsg_;
};
}
}