catch error value from krb5_ functions and exit