From 8a1d06be63c39d8b82fb921ccc4b804ee30b6260 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Fri, 13 Feb 2026 16:03:53 -0800 Subject: [PATCH] container: root: common: add interpreter exit function Wrapper (with optional message) to underlying interpreter exit call. --- container/src/root/common/utility.hh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/container/src/root/common/utility.hh b/container/src/root/common/utility.hh index b86c6f7..90d7dee 100644 --- a/container/src/root/common/utility.hh +++ b/container/src/root/common/utility.hh @@ -276,6 +276,19 @@ int exec(const std::string& cmd) return gSystem->Exec(cmd.c_str()); } +//! \brief Exit the interpreter with given status (and message) +//! \param code Exit code status (return code) +//! \param message Optional exit message +//! \since docker-finance 1.2.0 +void exit(const int code, const std::string& message = {}) +{ + // TODO(unassigned): logger + if (!message.empty()) + std::cout << "Exiting: '" << message << "'" << std::endl; + + gSystem->Exit(code); +} + //! \brief Make current timestamp //! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format //! \since docker-finance 1.0.0