@@ -80,23 +80,23 @@ public static void ThrowIfError(int error, string defaultErrorMessage = "Unknown
80
80
case OK :
81
81
return ;
82
82
case ErrorSecNoSuchKeychain :
83
- throw new InvalidOperationException ( $ "The keychain does not exist. ( { ErrorSecNoSuchKeychain } )" ) ;
83
+ throw new InteropException ( "The keychain does not exist." , error ) ;
84
84
case ErrorSecInvalidKeychain :
85
- throw new InvalidOperationException ( $ "The keychain is not valid. ( { ErrorSecInvalidKeychain } )" ) ;
85
+ throw new InteropException ( "The keychain is not valid." , error ) ;
86
86
case ErrorSecAuthFailed :
87
- throw new InvalidOperationException ( $ "Authorization/Authentication failed. ( { ErrorSecAuthFailed } )" ) ;
87
+ throw new InteropException ( "Authorization/Authentication failed." , error ) ;
88
88
case ErrorSecDuplicateItem :
89
- throw new InvalidOperationException ( $ "The item already exists. ( { ErrorSecDuplicateItem } )" ) ;
89
+ throw new InteropException ( "The item already exists." , error ) ;
90
90
case ErrorSecItemNotFound :
91
- throw new InvalidOperationException ( $ "The item cannot be found. ( { ErrorSecItemNotFound } )" ) ;
91
+ throw new InteropException ( "The item cannot be found." , error ) ;
92
92
case ErrorSecInteractionNotAllowed :
93
- throw new InvalidOperationException ( $ "Interaction with the Security Server is not allowed. ( { ErrorSecInteractionNotAllowed } )" ) ;
93
+ throw new InteropException ( "Interaction with the Security Server is not allowed." , error ) ;
94
94
case ErrorSecInteractionRequired :
95
- throw new InvalidOperationException ( $ "User interaction is required. ( { ErrorSecInteractionRequired } )" ) ;
95
+ throw new InteropException ( "User interaction is required." , error ) ;
96
96
case ErrorSecNoSuchAttr :
97
- throw new InvalidOperationException ( $ "The attribute does not exist. ( { ErrorSecNoSuchAttr } )" ) ;
97
+ throw new InteropException ( "The attribute does not exist." , error ) ;
98
98
default :
99
- throw new Exception ( $ " { defaultErrorMessage } ( { error } )" ) ;
99
+ throw new InteropException ( defaultErrorMessage , error ) ;
100
100
}
101
101
}
102
102
}
0 commit comments