Make ErrorEvent::new take cancelable and bubbling enums

This for references issue #4174.