Rename `error` event to `invalid` in docs