Error messages are a fairly common thing to mention, in both questions and answers, across many Stack Exchange communities. I think it would be valuable to have a markdown syntax to denote error messages in a manner that is visually distinct from the other offerings. I am fully aware of the current options to use either a blockquote (i.e.
> syntax) or generic code block (i.e. either
``` with no specified language, or indented with
<!-- language: lang-none --> ), and have been using both for 9 years now. Still, I believe that these two approaches are just work-arounds, making the best of what is available because what is ideal is not available.
Error messages are not quotes. I quote documentation, books, articles, people, and sometimes output / results fit well-enough into this.
Error messages are not code. I think we all agree on this, and so a generic / non-highlighted code block is often the reasonable approach as the fixed / monospace font plus preservation of whitespace lends itself well to this purpose. BUT, while this might be a better option than the blockquote, a generic code block should be for code that doesn't have a syntax highlighter, command-lines, occasionally output / results, etc.
Error messages are something else and should stand out. They are even handled separately at the OS / shell / code level (i.e.
stderr). A code block would suffice as long as it was obviously different than other code blocks. Perhaps all text in red and/or a red border? And maybe the syntax could be something like:
Msg 50505, State 10, Level 42
A horse is a horse,
of course of course
P.S. This question comes up from time to time, but I don't believe it has ever gotten a satisfactory answer. For example: