I'd like to have a way of properly adding multiline attachments/contexts to an error.
Currently, when passing in a multiline string, the \n will get renedered as \n instead of proper newlines.
While i understand that this is the best behavior in most cases, this is annoying when passing through pre-rendered exceptions, like toml deser errors which come formatted.
My current workaround is to do a err.to_string().spllit("\n") and adding each line as its own attachment. This is ugly and not at all what one should be doing.
Current error message:
● "FormatError: \u{1b}[31;1merror:\u{1b}[0m bad machine specification: failed to convert column #\u{1b}[35;1m3\u{1b}[0m in a row: '\u{1b}[35;1m hello world this is a very much invalid file\u{1b}[0m' to 'unsigned int'"
├ lix/lix-rs/src/machines.rs:218
├
│ ● "while deserializing TOML"
│ ├ lix/lix-rs/src/machines.rs:197
│ │
│ ● "TOML parse error at line 2, column 27\n |\n2 | hello world this is a very much invalid file\n | ^\nkey with no value, expected `=`\n"
│ ╰ lix/lix-rs/src/machines.rs:196
╰ "\n hello world this is a very much invalid file\n for both amazingly stupid formats\n and i am having a buuuuuunch of fun writ
error message i'd like:
● "FormatError: \u{1b}[31;1merror:\u{1b}[0m bad machine specification: failed to convert column #\u{1b}[35;1m3\u{1b}[0m in a row: '\u{1b}[35;1m hello world this is a very much invalid file\u{1b}[0m' to 'unsigned int'"
├ lix/lix-rs/src/machines.rs:223
├
│ ● "while deserializing toml"
│ ├ lix/lix-rs/src/machines.rs:197
│ ├ "TOML parse error at line 2, column 27"
│ │ " |"
│ │ "2 | hello world this is a very much invalid file"
│ │ " | ^"
│ │ "key with no value, expected `=`"
│ ╰ ""
╰ "\n hello world this is a very much invalid file\n for both amazingly stupid formats\n and i am having a buuuuuunch of fun writing this test file\n "
I'd like to have a way of properly adding multiline attachments/contexts to an error.
Currently, when passing in a multiline string, the
\nwill get renedered as\ninstead of proper newlines.While i understand that this is the best behavior in most cases, this is annoying when passing through pre-rendered exceptions, like toml deser errors which come formatted.
My current workaround is to do a
err.to_string().spllit("\n")and adding each line as its own attachment. This is ugly and not at all what one should be doing.Current error message:
error message i'd like: