implementing error codes in SecureConnection