Hacker News new | ask | show | jobs
by barrkel 377 days ago
My experience with errors is that error handling policy should be delegated to the caller. Low level parts of the stack shouldn't be handling errors; they generally don't know what to do.

A policy of handling errors usually ends up turning into a policy of wrapping errors and returning them up the stack instead. A lot of busywork.

1 comments

At this point I make all my functions return error even if they don't need it. You're usually one change away from discovering they actually do.