Yes, this is an example, but surely you'd want an example that shows the strength of doing this verbosely? A good example of a verbose error message system is Rust's compiler output (or newer clang/gcc outputs). Being verbose for no reason other than to be verbose is just wasting the users' time (or they just ignore the spam -- which is what I would do if I used a tool that spammed me with multiple lines of output whenever it hit an -EPERM).
Personally, something like:
% foo ./bar
foo: write config to "./bar": Permission denied
Is clearer to me than your example. Maybe something like % foo ./bar
foo: write config to "./bar": Permission denied
Hint: Have you tried <possible-recommendation>?
Is sometimes okay (and I have done this for my own projects as well), but it's something that should be done in moderation...> You're much more likely to be helpful to a confused user than someone grepping logs and looking for terse output on a single line.
There are two sides to this. Outputting lots of text can also cause a user to get confused (if we're talking about making things easy for not-necessarily-technical users).
When teaching (high-school) students to program, we quickly learned that even somewhat verbose output like Python's stacktraces can cause students to suddenly become anxious because there's a pile of text on their screen telling them they did something wrong. Adding more text to output does not always help, and you should keep that in mind.
[C:\]help sys0003
SYS0003: The system cannot find the path specified.
EXPLANATION: The path named in the command does not
exist for the drive specified or the path was
entered incorrectly.
[C:\]help sys0002
SYS0002: The system cannot find the file specified.
Explanation: The filename is incorrect or does not exist.
Action: Check the filename and retry the command.
Still, conceivably the app could check the file owner before showing the message. If it was a common enough error, it might be useful to do something like this.
There is a difference between an error title and error description. The description can and should be long to help clarify what is wrong. It's ok to be verbose. It's ok to spill out on multiple lines. You're much more likely to be helpful to a confused user than someone grepping logs and looking for terse output on a single line. That user can just use `grep -C` anyways.
I agree that it's useful to include the app name though.