mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
fix(integrations): improve error handling for API key creation
This commit is contained in:
parent
f0baf904ff
commit
1a5a57aa70
1 changed files with 2 additions and 2 deletions
|
|
@ -153,7 +153,7 @@ export default function Integrations() {
|
|||
prefix: `sm_${org?.id}_`,
|
||||
})
|
||||
if (res.error)
|
||||
throw new Error(res.error.message ?? "Failed to create API key")
|
||||
throw new Error("Failed to create API key", { cause: res.error })
|
||||
if (!res.data?.key) throw new Error("API key missing from response")
|
||||
return res.data.key
|
||||
},
|
||||
|
|
@ -185,7 +185,7 @@ export default function Integrations() {
|
|||
prefix: `sm_${org.id}_`,
|
||||
})
|
||||
if (res.error)
|
||||
throw new Error(res.error.message ?? "Failed to create API key")
|
||||
throw new Error("Failed to create API key", { cause: res.error })
|
||||
if (!res.data?.key) throw new Error("API key missing from response")
|
||||
return res.data.key
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue