Article:
 |
|
What I Hate About Your Programming Language
|
| Subject: |
|
Java: Catch all exceptions? |
| Date: |
|
2003-05-13 15:11:20 |
| From: |
|
zipwow
|
|
|
|
I wonder what the author means by: "... forcing every method to catch all exceptions that its child calls or may call can be tedious. I'd rather be able to ignore an exception and let it propagate upwards."
Isn't that the description of adding it to the throws clause of your own method?
-Zipwow
|
Showing messages 1 through 6 of 6.
-
Java: Catch all exceptions?
2003-05-13 15:27:43
anonymous2
[View]
-
Java: Catch all exceptions?
2003-05-13 19:30:50
anonymous2
[View]
-
Java: Catch all exceptions?
2003-05-13 17:50:15
anonymous2
[View]
-
Java: Catch all exceptions?
2003-05-13 17:19:41
anonymous2
[View]
-
Java: Catch all exceptions?
2003-05-13 15:44:26
anonymous2
[View]
-
Java: Catch all exceptions?
2003-05-13 16:03:56
zipwow
[View]
I circumvent that behavior by declaring (almost) all of my exceptions as runtime.
I don't think Java should require the addition of "throws" to the method declaration for non-runtime exceptions. It should just be implied.
Does anyone have an advantage that forcing the "throws" provides?