I generally prefer using assert to signal programmatic error.