* throw exception on invalid SessionResult when transforming to SendStatus

* add case for printing unknown SessionResult
pull/1693/head
Jeff Becker 3 years ago
parent 114c7bab62
commit 069d9487b7
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -39,7 +39,7 @@ namespace llarp
case SessionResult::EstablishFail:
return out << "establish failed";
}
return out;
return out << "???";
}
using RouterCallback = std::function<void(const RouterID&, const SessionResult)>;

@ -154,8 +154,8 @@ namespace llarp
case SessionResult::NoLink:
return SendStatus::NoLink;
}
// fall through case to appease compiler
return SendStatus::Congestion;
throw std::invalid_argument{
stringify("SessionResult ", result, " has no corrispoding SendStatus when transforming")};
}
void

Loading…
Cancel
Save