Skip to content

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

Merged
EdwardCooke merged 5 commits intoaaubry:masterfrom
skdishansachin:exception-stacktrace
Apr 9, 2026
Merged

Fix YamlException.ToString() to include stack trace#1084
EdwardCooke merged 5 commits intoaaubry:masterfrom
skdishansachin:exception-stacktrace

Conversation

@skdishansachin
Copy link
Copy Markdown
Contributor

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
This was referenced Apr 10, 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

2 participants