Added catch for exceptions.

Show error messages in a dialog box when a parse exception is thrown.