fixed CAT-531

added try/catch blocks on possible exception locations