Skip to content

Fix YamlException.ToString() to include stack trace - #1084

Merged
EdwardCooke merged 5 commits into
masterfrom
unknown repository
Apr 9, 2026
Merged

EdwardCooke merged 5 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Mar 24, 2026

Copy link
Copy Markdown

I’ve updated YamlException.ToString() to include base.ToString(). The previous version was overriding the standard .NET behavior and swallowing the stack trace and inner exceptions, which made debugging harder.

This change restores the diagnostic report while keeping the YAML position markers at the start of the string. I also added a new ToMessage() method for the keep the "Position - Message" format, which is clean for where you don't want to show a full stack trace.

I've also updated the unit tests to match the new format and verified everything passes.

close #1080

@EdwardCooke
EdwardCooke merged commit a868b95 into aaubry:master Apr 9, 2026
1 check passed
This was referenced Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stacktrace not getting printed when YamlException is thrown

1 participant