Could this really signal the end of try/catch with node

For discussion?


F**k paywalls!

Oh well, maybe in the future.

We use this technique in the Go programming language - it doesn't have a Try/Catch in the traditional sense (but there's something very similar called "panic")

db, err := database.connect()
if err != nil {
    return err // return error to the caller, or panic(err) to crash
}

Panics can be recovered, so they kinda act like Try/Catch, but it's usually reserved for very specific circumstances. We usually just check the err variable.

It's common for Go programmers to do the following:

db, err := database.connect()
check(err)

In which check is a function:

func check(err error) {
    if err != nil {
        panic(err)
    }
}