Lo, these many years ago, I took a typing class (manual typewriters, for a true sense of age!). We were instructed to use ALL CAPS as a substitute for bold and underline (__) as a substitute for italics.
When I started going on line (long before publicly available Internet), I was taught to surround text with asterisk (*) when I intended bold and with underscore (_) when I intended italic. If you pay attention to the markup used in this forum, you can see how those conventions have been honoured and expressed over time and through changing technology.
In English classes (native English, not ESL or second-language) we were also taught to use ALL CAPS to separate the 'description' from the 'real' text. So, in your error message example, ERROR: is telling you that what follows is an error message as distinct from a warning message (WARNING:) or a purely informational message (INFO:). A similar concept applies to dialogue the way it is normally written in plays.
As a side note, I was also taught that underline was introduced with the typewriter and that previous to that scribes and typesetters used actual italics (and bold). I have not been able to confirm that anywhere, though.
The other answers are, of course, also correct.