[doc] Add better documentation for the `error` event

Fixes #253