Skip to content

Use Claude Code with your ChatGPT, Kimi, Cursor or Grok subscription via a local Anthropic-compatible proxy

Rust

keychain: throw when SecKeychainItemDelete fails

Raine Virtaf50f063f3727
diff --git a/src/keychain.ts b/src/keychain.ts
index 54b19d0..5a318c5 100644
--- a/src/keychain.ts
+++ b/src/keychain.ts
@@ -124,8 +124,9 @@ export function keychainDelete(service: string, account: string): void {
if (s !== errSecSuccess) throw keychainError("find for delete", s)
const itemRef = readPtr(itemBuf)
- sym().SecKeychainItemDelete(itemRef)
+ const delStatus = sym().SecKeychainItemDelete(itemRef) as number
sym().CFRelease(itemRef)
+ if (delStatus !== errSecSuccess) throw keychainError("delete", delStatus)
}
function keychainError(op: string, code: number): Error {