Move error event catching earlier, so we can catch syntax errors.
Merge pull request #42 from PencilCode/earlyerror

Move error event catching earlier, so we can catch syntax errors.