News for hackers. Stuff that matters.
Re:From First Principles: Why Scala? by spion on Thursday February 11, 2021 @02:16PM (#26105850)
And will you get a call trace when you do that?
Re:From First Principles: Why Scala? by hderms on Thursday February 11, 2021 @04:23PM (#26107446)
we use error types that extend Exception specifically for the purpose of getting a call trace. A lot of people hate doing this but it's been extremely helpful on our project
Re:From First Principles: Why Scala? by yw3410 on Thursday February 11, 2021 @06:34PM (#26108977)
We do this too - but the other problem you get is that Exception aren't treated specially (like Any and Nothing) in the inference hierarchy so errors are liable to "collapse" to Throwable or Exception. I like wrapping them with a new type if possible to stop this behaviour.