wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
Pandaception Class Reference

Exception type for user-facing circuit errors. More...

#include <Common.h>

Inheritance diagram for Pandaception:
[legend]

Public Member Functions

QString englishMessage () const
 Returns the English (non-translated) message for logging and crash reports.
const char * file () const
 Returns the source file where the exception was thrown, or nullptr.
int line () const
 Returns the source line where the exception was thrown, or 0.
 Pandaception (const QString &translatedMessage, const QString &englishMessage, const char *file=nullptr, int line=0)
 Constructs the exception with throw-site location for Sentry.
 ~Pandaception () override

Detailed Description

Exception type for user-facing circuit errors.

Pandaception carries both a translated message (for display in the UI) and the original English message (for logging and Sentry reports). Throw it via the PANDACEPTION() macro to take advantage of Qt's tr() mechanism.

Definition at line 54 of file Common.h.

Constructor & Destructor Documentation

◆ Pandaception()

Pandaception::Pandaception ( const QString & translatedMessage,
const QString & englishMessage,
const char * file = nullptr,
int line = 0 )
explicit

Constructs the exception with throw-site location for Sentry.

Parameters
translatedMessageLocalized message shown to the user.
englishMessageEnglish message for logging/Sentry.
fileSource file where the exception was thrown (FILE).
lineSource line where the exception was thrown (LINE).

Definition at line 34 of file Common.cpp.

References englishMessage(), file(), and line().

◆ ~Pandaception()

Pandaception::~Pandaception ( )
overridedefault

Out-of-line virtual destructor acts as the class's key function so the Itanium C++ ABI emits the typeinfo and vtable in exactly one TU (Common.cpp) with strong external linkage. Without this, every TU that throws PANDACEPTION emits its own weak typeinfo, and on macOS ld64 can leave per-TU hidden copies un-coalesced — breaking catch (const std::exception &) in Application::notify because the throw and catch sites end up with different type_info* pointers (libc++abi requires pointer equality, unlike libstdc++ which falls back to typeinfo-name strcmp). See .claude/SENTRY_TRIAGE.md §A25.

Member Function Documentation

◆ englishMessage()

QString Pandaception::englishMessage ( ) const

Returns the English (non-translated) message for logging and crash reports.

Definition at line 50 of file Common.cpp.

Referenced by Pandaception().

◆ file()

const char * Pandaception::file ( ) const

Returns the source file where the exception was thrown, or nullptr.

Definition at line 55 of file Common.cpp.

Referenced by Pandaception().

◆ line()

int Pandaception::line ( ) const

Returns the source line where the exception was thrown, or 0.

Definition at line 60 of file Common.cpp.

Referenced by Pandaception().


The documentation for this class was generated from the following files: