Cahnged ThrowException to escape characters
Added TryCatchException to catch error objects