Skip to content

Commit 796b9a8

Browse files
committed
fix(helpscout): explain empty-body 404 responses in the error extractor
1 parent e24a910 commit 796b9a8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/sim/tools/error-extractors.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,15 @@ const ERROR_EXTRACTORS: ErrorExtractorConfig[] = [
261261
{
262262
id: 'helpscout-errors',
263263
description:
264-
'Help Scout vnd.error responses: the top-level message plus each embedded field error as `path: message`, without the rejected value',
264+
'Help Scout vnd.error responses: the top-level message plus each embedded field error as `path: message`, without the rejected value. Help Scout answers a missing resource with an empty 404 body.',
265265
examples: ['Help Scout'],
266266
extract: (errorInfo) => {
267267
const data = errorInfo?.data
268-
if (!data || typeof data !== 'object' || Array.isArray(data)) return undefined
268+
if (!data || typeof data !== 'object' || Array.isArray(data)) {
269+
return errorInfo?.status === 404
270+
? 'Not found: the Help Scout resource does not exist or the connected user cannot access it'
271+
: undefined
272+
}
269273
const message = typeof data.message === 'string' ? data.message.trim() : ''
270274
const embedded = data._embedded
271275
const errors: unknown[] =

0 commit comments

Comments
 (0)