Added missing onError handler.

Without this function it was impossible to catch a Parser Error.