Add assertion that terminate clio (#994)

Fixes #893.

Also added termination handler to print backtrace on crash, so fixes #929.
This commit is contained in:
Sergey Kuznetsov
2023-11-21 13:06:04 +00:00
committed by GitHub
parent 3bab90ca7a
commit 8ebe2d6a80
41 changed files with 420 additions and 158 deletions

View File

@@ -20,6 +20,7 @@
#pragma once
#include <rpc/Errors.h>
#include <util/Assert.h>
#include <web/interface/ConnectionBase.h>
#include <boost/beast/http.hpp>
@@ -82,7 +83,9 @@ public:
case rpc::ClioError::rpcMALFORMED_ADDRESS:
case rpc::ClioError::rpcINVALID_HOT_WALLET:
case rpc::ClioError::rpcFIELD_NOT_FOUND_TRANSACTION:
assert(false); // this should never happen
ASSERT(
false, "Unknown rpc error code {}", static_cast<int>(*clioCode)
); // this should never happen
break;
}
} else {