Skip to content

Commit 7456b38

Browse files
committed
fix(ashby): use getErrorMessage instead of inline error-message extraction
check:utils bans the e instanceof Error ? e.message : fallback pattern in favor of getErrorMessage(e, fallback?) from @sim/utils/errors.
1 parent a1ff635 commit 7456b38

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/blocks/blocks/ashby.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getErrorMessage } from '@sim/utils/errors'
12
import { AshbyIcon } from '@/components/icons'
23
import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types'
34
import { getTrigger } from '@/triggers'
@@ -27,7 +28,7 @@ function parseSocialLinksInput(value: unknown): Array<{ type: string; url: strin
2728
parsed = JSON.parse(value)
2829
} catch (error) {
2930
throw new Error(
30-
`Invalid JSON in Ashby social links: ${error instanceof Error ? error.message : String(error)}. Expected a JSON array like [{"type":"Twitter","url":"https://twitter.com/x"}].`
31+
`Invalid JSON in Ashby social links: ${getErrorMessage(error)}. Expected a JSON array like [{"type":"Twitter","url":"https://twitter.com/x"}].`
3132
)
3233
}
3334
if (!Array.isArray(parsed)) {

0 commit comments

Comments
 (0)