fix(raycast): skip HTML error bodies and trim comments

This commit is contained in:
Mahesh Sanikommu 2026-10-12 22:14:59 -07:00
parent 6ff5b63a43
commit cb98a5117a
3 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -16,9 +16,7 @@ export function createDeferredPrefillOwner(
if (active && prefillOwnsValue && value) {
applyValue(value)
}
} catch {
// Selection is unavailable; keep the current value unchanged.
}
} catch {}
})()
return {

View file

@ -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()) {