News for hackers. Stuff that matters.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by sieve on Thursday November 05, 2026 @03:28PM (#50384052)
It might throw one. There is a difference between documenting what exceptions can be thrown and forcing every consumer to handle them.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by spullara on Thursday November 05, 2026 @04:10PM (#50384489)
returning a non-success you either handle it or pass it up the chain, potentially with not a lot of information about what originally caused it. with an exception you can retain the full information about what happened by either rethrowing it, throwing your own exception with it embedded as the cause or declaring that you don't handle it by saying you can throw it.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by sieve on Thursday November 05, 2026 @04:42PM (#50384856)
I generally prefer exceptions to result codes. You can even use the mechanism to throw useful results across nested function calls.

I do prefer Maybe/Option/Either style returns in some cases though. Makes for a cleaner API.

So each method has its uses.

Re:Alpine Linux Security advisory: OpenSSH-server password a... by spullara on Friday November 06, 2026 @06:00PM (#50399656)
I also have this nuanced view. I am glad my hashmaps don't throw KeyNotFoundException.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by mahboi on Thursday November 05, 2026 @06:34PM (#50386128)
Eh, it's weird. You usually don't care exactly what type of exception is thrown. If you do, usually you only care about that one type and the rest fall into the "unexpected error" category. HTTP did this well with 4xx being client's fault and 5xx being server's fault.