Skip to content

Stacktrace not getting printed when YamlException is thrown #1080

Description

@Lightfire228

YamlException overrides ToString(), but doesn't include the stacktrace.

This is causing the stderr printout to not include the stacktrace when a SyntaxErrorException gets thrown during deserialization

If I change the line to

return $"({Start}) - ({End}): {Message}\n{StackTrace}";

it prints as expected


Although, i think the better solution is to not override ToString(), then update any logic that relies on the message format to use this instead

        public string ToMessage()
        {
            return $"({Start}) - ({End}): {Message}";
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions