points by sieve 2 days ago | 0 comments
It might throw one. There is a difference between documenting what exceptions can be thrown and forcing every consumer to handle them.
[–] mahboi 2 days ago
Yeah, checked exceptions are weird. Almost everything has some way to fail. The exact type of exception is usually meaningless, more like there are a couple of broad categories analogous to HTTP 4xx vs 5xx, and even then you usually don't want to handle it right there.
[–] spullara 2 days ago
[–] sieve 2 days ago
I do prefer Maybe/Option/Either style returns in some cases though. Makes for a cleaner API.
So each method has its uses.
[–] spullara 1 day ago