Implementation of the base error system for gp-engine#2
Merged
mallory-scotton merged 38 commits intomainfrom May 1, 2026
Merged
Implementation of the base error system for gp-engine#2mallory-scotton merged 38 commits intomainfrom
mallory-scotton merged 38 commits intomainfrom
Conversation
…ert it to a string view
|
Welcome to Graphical Playground (gp-engine), @mallory-scotton! 🎉 We are thrilled to have you here and appreciate you opening your first Pull Request! What's next?
Thanks again for your contribution! |
There was a problem hiding this comment.
Pull request overview
This PR introduces a foundational error-handling subsystem for gp-engine (ErrorSystem + ErrorRecord/Registry/Context + multiple sinks) and adds supporting container utilities (vector erase helpers and std::format integration for gp::String/StringView), along with new unit tests exercising the container additions.
Changes:
- Add new
gp::errorerror system: error records, registry, context scoping, filtering predicates, and sink fan-out (console/file/breakpoint/abort/multi). - Add
gp::VectoreraseIf/erasehelpers andgp::String::formatplusstd::formattersupport forgp::Stringandgp::StringView. - Extend Catch2 tests for Vector erasure helpers and String formatting; update
.clang-formatlambda indentation.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
| source/runtime/core/tests/container/Vector.tests.cpp | Adds unit tests for gp::eraseIf / gp::erase on gp::Vector. |
| source/runtime/core/tests/container/BasicString.tests.cpp | Adds unit tests for gp::String::format and formatting of gp::String/gp::StringView. |
| source/runtime/core/public/errors/sinks/MultiSink.hpp | Declares fan-out sink for dispatching records to multiple sinks. |
| source/runtime/core/public/errors/sinks/FileSink.hpp | Declares file-appending sink API. |
| source/runtime/core/public/errors/sinks/ConsoleSink.hpp | Declares console sink API (ANSI color, stacktrace/cause toggles). |
| source/runtime/core/public/errors/sinks/BreakpointSink.hpp | Declares debugger-break sink API. |
| source/runtime/core/public/errors/sinks/AbortSink.hpp | Declares process-termination sink API. |
| source/runtime/core/public/errors/Forward.hpp | Adds forward declarations for new error types and sinks. |
| source/runtime/core/public/errors/ErrorSystem.hpp | Declares singleton dispatcher API and statistics. |
| source/runtime/core/public/errors/ErrorSink.hpp | Declares sink base class and filtering/dispatch wrapper. |
| source/runtime/core/public/errors/ErrorSeverity.hpp | Adds severity aliases and severity metadata helpers. |
| source/runtime/core/public/errors/ErrorRegistry.hpp | Declares registry of error-code metadata and registration macros. |
| source/runtime/core/public/errors/ErrorRecord.hpp | Declares ErrorRecord payload and metadata/cause APIs; stacktrace support toggles. |
| source/runtime/core/public/errors/ErrorFilter.hpp | Adds composable filter predicates for ErrorRecord. |
| source/runtime/core/public/errors/ErrorContext.hpp | Adds thread-local context stack + RAII scope/tag macros. |
| source/runtime/core/public/errors/ErrorConfig.hpp | Updates include to new ErrorSeverity.hpp. |
| source/runtime/core/public/errors/Error.hpp | Adds raise/wrap helpers, gp::Expected, and convenience macros. |
| source/runtime/core/public/container/Vector.hpp | Adds gp::eraseIf / gp::erase helpers for gp::Vector. |
| source/runtime/core/public/container/BasicStringView.hpp | Adds std::formatter support for gp::BasicStringView. |
| source/runtime/core/public/container/BasicString.hpp | Adds gp::BasicString::format, asView(), and std::formatter support for gp::BasicString. |
| source/runtime/core/public/container/Array.hpp | Formatting-only lambda indentation changes. |
| source/runtime/core/private/errors/sinks/MultiSink.cpp | Implements sink registration/removal and fan-out dispatch/flush. |
| source/runtime/core/private/errors/sinks/FileSink.cpp | Implements file sink write format and metadata/stacktrace emission. |
| source/runtime/core/private/errors/sinks/ConsoleSink.cpp | Implements console output formatting, optional stacktrace/cause output. |
| source/runtime/core/private/errors/sinks/BreakpointSink.cpp | Implements debug-break triggering on severity threshold. |
| source/runtime/core/private/errors/sinks/AbortSink.cpp | Implements abort/terminate triggering on severity threshold. |
| source/runtime/core/private/errors/ErrorSystem.cpp | Implements singleton init/shutdown, dispatch path, stats, and signal handling. |
| source/runtime/core/private/errors/ErrorSink.cpp | Implements sink filtering and dispatch wrapper. |
| source/runtime/core/private/errors/ErrorRegistry.cpp | Implements registry storage, lookups, and dump formatting. |
| source/runtime/core/private/errors/ErrorRecord.cpp | Implements metadata/cause helpers and report formatting. |
| source/runtime/core/private/errors/ErrorContext.cpp | Implements context stack push/pop/tag and flattening. |
| source/launch/editor/private/Main.cpp | Wires error system into the editor entrypoint and emits demo records. |
| .clang-format | Changes LambdaBodyIndentation setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…es to gp::String Agent-Logs-Url: https://github.com/GraphicalPlayground/gp-engine/sessions/af614e83-5305-4b16-8ff1-e505f58b3c9c Co-authored-by: mallory-scotton <145684062+mallory-scotton@users.noreply.github.com>
mallory-scotton
added a commit
that referenced
this pull request
May 1, 2026
Implementation of the base error system for gp-engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes
noneType of Change
Description
Adding new utility to do some error handling inside the gp-engine, the error system utilize sinks as consumers to get error record. We can also add custom sink and custom error message, code, remediation etc.
There is a lot of configuration available in order to make it work great, there is also pre-defined config base on the mode of ships.
Docs
NO DOCS FOR THE MOMENT
Checklist
gp-engineC++ Coding Standard.GP Contributor License Agreement
I give to the Graphical Playground Team, LLC permission to license my contributions on any terms
they like. I am giving them this license in order to make it possible for them to accept my
contributions into their project.