mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-26 06:04:08 +00:00
fix(raycast): skip HTML error bodies and trim comments
This commit is contained in:
parent
6ff5b63a43
commit
cb98a5117a
3 changed files with 3 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
|||
// Skips HTML error pages (proxy 5xx) so the toast falls back to the status text.
|
||||
export function extractApiErrorMessage(raw: string): string | undefined {
|
||||
const body = raw.trim()
|
||||
if (!body) return undefined
|
||||
|
|
@ -12,7 +13,7 @@ export function extractApiErrorMessage(raw: string): string | undefined {
|
|||
if (typeof message === "string" && message.trim()) return message
|
||||
}
|
||||
} catch {
|
||||
return body
|
||||
return body.startsWith("<") ? undefined : body.slice(0, 300)
|
||||
}
|
||||
|
||||
return undefined
|
||||
|
|
|
|||
|
|
@ -16,9 +16,7 @@ export function createDeferredPrefillOwner(
|
|||
if (active && prefillOwnsValue && value) {
|
||||
applyValue(value)
|
||||
}
|
||||
} catch {
|
||||
// Selection is unavailable; keep the current value unchanged.
|
||||
}
|
||||
} catch {}
|
||||
})()
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import type { ComponentType } from "react"
|
|||
|
||||
export function withSupermemory<P extends object>(Component: ComponentType<P>) {
|
||||
return function SupermemoryWrappedComponent(props: P) {
|
||||
// Let each command enforce its own endpoint-specific permissions and rate limit.
|
||||
const { apiKey } = getPreferenceValues<Preferences>()
|
||||
|
||||
if (!apiKey.trim()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue