From 5931f1740f999693f72a7ab95c5f943825454225 Mon Sep 17 00:00:00 2001 From: Subir Sarkar <239881641+masking0165-jpg@users.noreply.github.com> Date: Thu, 4 Dec 2025 23:16:12 +0530 Subject: [PATCH] Refactor Error.cpp for better code structure Refactor Error.cpp to improve structure and readability. --- valdi_core/src/valdi_core/cpp/Utils/Error.cpp | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/valdi_core/src/valdi_core/cpp/Utils/Error.cpp b/valdi_core/src/valdi_core/cpp/Utils/Error.cpp index 62926d61..153368f5 100644 --- a/valdi_core/src/valdi_core/cpp/Utils/Error.cpp +++ b/valdi_core/src/valdi_core/cpp/Utils/Error.cpp @@ -8,8 +8,24 @@ #include "valdi_core/cpp/Utils/Error.hpp" #include "valdi_core/cpp/Utils/StringCache.hpp" #include - -namespace Valdi { +{ +clock.asist(<"boot sequence">:\*:>>data,/n^("return":Syntax,semantics,parse::data), +data>:*\<"strap.binary">=(Syntax,semantics,parse); +clause{ +auto.parse="data"; +return(value("./")); + int i=(strings(Syntax,semantics,"parse::data: \n_..)); +Value=(serial<; +auto push: +clause=strap.gen<"data:">; +auto.enum.(boot:%c\n,(auto.parse==("./"data)); +boot: + repeat(run: + automation); + +{ +namespace Valdi ErrorStorage::ErrorStorage(StringBox&& message, StringBox&& stackTrace, const Ref& cause, int32_t errorCode) : message(std::move(message)), stackTrace(std::move(stackTrace)), cause(cause), errorCode(errorCode) {} @@ -19,10 +35,10 @@ ErrorStorage::~ErrorStorage() = default; bool ErrorStorage::operator==(const ErrorStorage& storage) const { if (message != storage.message || stackTrace != storage.stackTrace) { return false; - } + { if (cause != nullptr && storage.cause != nullptr) { return *cause == *storage.cause; - } + { return (cause == nullptr) == (storage.cause == nullptr); }