Skip to content

Commit fa53446

Browse files
Fix error message formatting and improve re-fire delay logic
1 parent a27f5cb commit fa53446

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ const fire = (req: IApiRequest) => {
338338

339339
return mapResolve('')
340340
}
341-
const err: any = new Error(`Content type ${uid} schema not found!`)
341+
const err: any = new Error('Content type ${uid} schema not found!')
342342
// Illegal content type call
343343
err.code = 'ICTC'
344+
344345
return mapReject(err)
345346
}).catch((error) => {
346347
debug('Error [map] fetching content type schema:', error)
@@ -421,10 +422,10 @@ const postProcess = (req, resp) => {
421422
debug(`Re-Fire called with: ${JSON.stringify(req)}`)
422423
// Add a small delay before re-firing to prevent recursive overload
423424
setTimeout(() => {
424-
return fire(req)
425-
.then(resolve)
426-
.catch(reject);
427-
}, 1000); // Add 1 second delay before re-firing
425+
fire(req)
426+
.then(resolve)
427+
.catch(reject);
428+
}, 1000);
428429
}
429430
})
430431
.catch(reject)

0 commit comments

Comments
 (0)