Updating error handling mechanism
added syntax and lexical errors
updates error handling