top | item 4563024

(no title)

luriel | 13 years ago

Panic() should only be used to signal either programmer error, or truly panic-worthy situations where state is so messed up that crashing is the only good option.

Put another way: when you call an API correctly, it should be safe to assume it will never panic().

Panic/recover can be used in rare occasions within libraries to do more exception-ish style error handling, but those panics should never be allowed to escape and cross API boundaries.

discuss

order

No comments yet.