Remove names Status constructors.

GitOrigin-RevId: bd196c8a3d5657f2f8ce3e5ceaf3e64821177398
This commit is contained in:
levlam 2018-06-21 23:20:32 +03:00
parent 8b5b73508a
commit f18dea245c
3 changed files with 5 additions and 16 deletions

View File

@ -532,7 +532,7 @@ class RequestActor : public Actor {
void raw_event(const Event::Raw &event) override {
if (future_.is_error()) {
auto error = future_.move_as_error();
if (error == Status::Hangup()) {
if (error == Status::Error<FutureActor<T>::Hangup>()) {
// dropping query due to lost authorization or lost promise
// td may be already closed, so we should check is auth_manager_ is empty
bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized();

View File

@ -461,6 +461,8 @@ class FutureActor final : public Actor {
enum State { Waiting, Ready };
public:
static constexpr int Hangup = 426487;
FutureActor() = default;
FutureActor(const FutureActor &other) = delete;
@ -534,7 +536,7 @@ class FutureActor final : public Actor {
}
void hangup() override {
set_error(Status::Hangup());
set_error(Status::Error<Hangup>());
}
void start_up() override {

View File

@ -85,11 +85,8 @@ class Status {
Status() = default;
bool operator==(const Status &other) const {
if (get_info().static_flag) {
return ptr_ == other.ptr_;
}
return false;
}
Status clone() const TD_WARN_UNUSED_RESULT {
if (is_ok()) {
@ -136,16 +133,6 @@ class Status {
return status.clone_static();
}
static Status InvalidId() TD_WARN_UNUSED_RESULT {
static Status status(true, ErrorType::general, 0, "Invalid Id");
return status.clone_static();
}
static Status Hangup() TD_WARN_UNUSED_RESULT {
static Status status(true, ErrorType::general, 0, "Hangup");
return status.clone_static();
}
StringBuilder &print(StringBuilder &sb) const {
if (is_ok()) {
return sb << "OK";