An identifier name is required to simplify parsing for the compiler. And throwing an exception in a catch clause means that it is considered bad practice. IMHO is rarely a good idea - in production code you should (almost always) print / write it and / or reconstruct it. Therefore, do not use the identifier name should be an exception (not intended for puns), and not a rule.
But if you really have weight so omit does not use it, you can add a comment to explain your point, [Refresh2] and / or tell the IDE to suppress this kind of check for this particular code block (most IDEs allow this) [/ Update2] .
Update: OK, “bad practice” might be too strong a word :-) Let me try to explain my point better.
What I mean is that usually when you encounter an exception, it is preferable to try to use / use as much information from it as possible. This means that you are really referring to an exception variable.
In the above example, if you only register the message "Error while trying to read from the client", this is a very limited amount of information. The actual cause of the problem may be (just a few guesses) a damaged file, a network error, a formatting error ... Registering data in IOException will provide much more detailed information about this, making it difficult to fix the problem.
source share