Skip to content

Commit

Permalink
Slightly improve a handful of error message texts.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Jul 30, 2024
1 parent 0cde3be commit 54269d2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib-protocol/source/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ task<void> Channel::Send(const Buffer &data) {
writ = std::move(error); });
}, *(sctp->*Loot<SctpDataChannel$network_thread_>::pointer));

orc_assert((co_await *writ).ok());
const auto error(co_await *writ);
orc_assert_(error.ok(), error.message());
}

task<std::string> Description(const S<Base> &base, std::vector<std::string> ice) {
Expand Down
2 changes: 1 addition & 1 deletion lib-protocol/source/layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ auto Layer(Base &base, const Locator &locator, const std::function<bool (const s

co_return co_await std::move(code)(std::make_unique<Type_<boost::beast::ssl_stream<Adapter>>>(std::move(stream)));
} else orc_assert(false);
}, "connected to " << endpoint); } catch (...) {
}, "using endpoint " << endpoint); } catch (...) {
// XXX: maybe I should merge the exceptions? that would be cool
if (error == nullptr)
error = std::current_exception();
Expand Down
2 changes: 1 addition & 1 deletion lib-protocol/source/valve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Valve {

protected:
void Stop() noexcept {
orc_insist(!shut_);
orc_insist_(!shut_, "double stop: " << type_);
shut_();
}

Expand Down
2 changes: 1 addition & 1 deletion srv-daemon/source/croupier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Croupier {

const S<Lottery1> &Find1(const Address &contract, const uint256_t &chain) {
const auto lottery(lotteries1_.find(chain));
orc_assert(lottery != lotteries1_.end());
orc_assert_(lottery != lotteries1_.end(), "unsupported lottery chain " << chain);
orc_assert(lottery->second->Contract() == contract);
return lottery->second;
}
Expand Down
5 changes: 3 additions & 2 deletions srv-daemon/source/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void Server::Submit0(Pipe<Buffer> *pipe, const Socket &source, const Bytes32 &id

const auto until(start + range);
const auto now(Timestamp());
orc_assert(until > now);
orc_assert_(until > now, "expired ticket (by " << (now - until) << " seconds)");

const auto &lottery(croupier_->Find0(contract, chain, recipient));
const uint64_t gas(receipt.size() == 0 ? 84000 /*83267*/ : 103000);
Expand Down Expand Up @@ -275,8 +275,9 @@ void Server::Submit1(Pipe<Buffer> *pipe, const Socket &source, const Bytes32 &id

orc_assert_(recipient == croupier_->Recipient(), recipient << " != " << croupier_->Recipient() << " in " << data);

const auto until(issued + expire);
const auto now(Timestamp());
orc_assert(issued + expire > now);
orc_assert_(until > now, "expired ticket (by " << (now - until) << " seconds)");

const auto &lottery(croupier_->Find1(contract, chain));
const uint64_t gas(60000);
Expand Down

0 comments on commit 54269d2

Please sign in to comment.