Comment

Comment by carsongross

You shouldn't have to specify the error states in each method, this is why what I'm advocating is different than a simple enum:

- You don't need to define a constructor to take the error string

- You don't need to implement method dispatch (all methods of an error state instance automatically throw, like null does)

Enums are close, but not quite right.

parent carsongross 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton