▲ | necovek 5 months ago | |
There is a log message that won't be output in that case: whether getting a full, "native" FileNotFound exception is better is beside the point, since the goal of the code was obviously to print a custom error message. And it's trivial to achieve the desired effect sanely:
It'd even be fewer lines of code. | ||
▲ | theteapot 5 months ago | parent [-] | |
Or even fewer by doing it in a global exception handler instead of every time you try to open a file, since all your doing is piping the error though logger. |