From 09b33a05dd806b07fe789c2187a98bc2135c3428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Tue, 12 Oct 2021 12:51:44 +0200 Subject: [PATCH] Document DEV_SIMPLE_EXCEPTION macro --- libsolutil/Exceptions.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsolutil/Exceptions.h b/libsolutil/Exceptions.h index d83d8004b..684c5a051 100644 --- a/libsolutil/Exceptions.h +++ b/libsolutil/Exceptions.h @@ -56,6 +56,10 @@ private: ::boost::throw_line(__LINE__) \ ) +/// Defines an exception type that's meant to signal a specific condition and be caught rather than +/// unwind the stack all the way to the top-level exception handler and interrupt the program. +/// As such it does not carry a message - the code catching it is expected to handle it without +/// letting it escape. #define DEV_SIMPLE_EXCEPTION(X) struct X: virtual ::solidity::util::Exception { const char* what() const noexcept override { return #X; } } DEV_SIMPLE_EXCEPTION(InvalidAddress);