4 ms·
For something as simple as cat that may work fine. But that message actually fails to say why it failed. It just gives you a fact that is presumably related to
by kevincox 3y ago
For something as simple as cat that may work fine. But that message actually fails to say why it failed. It just gives you a fact that is presumably related to the exit code. In fact it doesn't even say it failed at all!, if your shell doesn't show the exit code you may read this as a warning or other non-critical information..
While it is hard to argue with succinctness of an error from such a simple program it may be better to say something like:
Fatal error: Couldn't open /etc/whatever. No such file or directory.
This says:
1. What failed. (Couldn't open /etc/whatever)
2. Why it failed. (No such file or directory)
3. How this was handled (Fatal)