Skip to content

Implementation of the base error system for gp-engine#2

Merged
mallory-scotton merged 38 commits intomainfrom
feat/error-system
May 1, 2026
Merged

Implementation of the base error system for gp-engine#2
mallory-scotton merged 38 commits intomainfrom
feat/error-system

Conversation

@mallory-scotton
Copy link
Copy Markdown
Member

Closes none

Type of Change

  • 🐞 Bug Fix (non-breaking change which fixes an issue)
  • ✨ New Feature (non-breaking change which adds functionality)
  • 💥 Breaking Change (fix or feature that would cause existing functionality to not work as expected)
  • 🧹 Refactor (code cleanup, architectural improvement, or progressive abstraction)
  • 📖 Documentation Update
  • 🧪 Tests / CI / Build System (CMake) Update

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

  • My code follows the gp-engine C++ Coding Standard.
  • I have compiled the engine successfully using the modern C++23 toolchain (GCC 13+, Clang 16+, or MSVC 19.38+) and CMake.
  • I have performed a self-review of my code and added comments, especially in complex areas like shader programming or math-heavy algorithms.
  • I have updated the relevant API reference or learning path documentation (if applicable).
  • My changes generate no new compiler warnings in the build log.
  • I have read and agree to the Code of Conduct and Contributing Guidelines.

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.

As far as the law allows, my contributions come as is, without any warranty or condition, and I
will not be liable to anyone for any damages related to this software or this license, under any
kind of legal claim.

Copilot AI review requested due to automatic review settings May 1, 2026 14:32
@mallory-scotton mallory-scotton requested a review from a team as a code owner May 1, 2026 14:32
@mallory-scotton mallory-scotton added priority: critical Blocking issue requiring immediate attention scope: engine gp-engine: Core C++ rendering library type: feature New functionality or enhancement labels May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

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?

  • Please ensure your code follows our formatting guidelines.
  • If you haven't already, take a quick look at our Contributing Guidelines.
  • A maintainer will review your code shortly.

Thanks again for your contribution!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::error error system: error records, registry, context scoping, filtering predicates, and sink fan-out (console/file/breakpoint/abort/multi).
  • Add gp::Vector eraseIf/erase helpers and gp::String::format plus std::formatter support for gp::String and gp::StringView.
  • Extend Catch2 tests for Vector erasure helpers and String formatting; update .clang-format lambda 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.

Comment thread source/runtime/core/public/errors/ErrorRegistry.hpp
Comment thread source/runtime/core/private/errors/sinks/AbortSink.cpp
Comment thread source/runtime/core/private/errors/ErrorSystem.cpp
Comment thread source/runtime/core/private/errors/sinks/ConsoleSink.cpp
Comment thread source/runtime/core/private/errors/sinks/FileSink.cpp
Comment thread source/runtime/core/public/errors/ErrorRecord.hpp Outdated
Comment thread source/runtime/core/private/errors/ErrorSystem.cpp
Comment thread source/runtime/core/private/errors/ErrorRecord.cpp
Comment thread source/runtime/core/private/errors/ErrorSystem.cpp
Comment thread source/runtime/core/private/errors/ErrorSystem.cpp
…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 mallory-scotton merged commit 9dc990a into main May 1, 2026
5 checks passed
@mallory-scotton mallory-scotton deleted the feat/error-system branch May 1, 2026 15:19
mallory-scotton added a commit that referenced this pull request May 1, 2026
Implementation of the base error system for gp-engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: critical Blocking issue requiring immediate attention scope: engine gp-engine: Core C++ rendering library type: feature New functionality or enhancement type: tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants