Listen to error events from Structs while parsing

Fixes #1 by listening for `error` events, and setting `hasFailed` flags to tell what to return.

- [ ] Write more test cases for valid examples