fix: Errors going to the same one

Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2023-04-05 14:52:14 +02:00
parent 19e3892099
commit 908d43f299
Signed by: Florian Bouillon
GPG Key ID: E05B3A94178D3A7C

View File

@ -101,12 +101,13 @@ server.post('/', async (req, res) => {
overrides: overrides overrides: overrides
}) })
} else if (line.includes('ETIMEDOUT') || line.includes('Command failed')) { } else if (line.includes('ETIMEDOUT')) {
await fs.rm(stlPath) await fs.rm(stlPath)
return createErrorResponse(res, { return createErrorResponse(res, {
title: 'File is taking too long to process', title: 'File is taking too long to process',
status: 400, status: 400,
detail: `The file you are trying to process is too large (${req.body.length}o) to be processed in less than 60 secs`, detail: `The file you are trying to process takes too long to be processed`,
processingTimeoutMillis: 60000,
fileId: file, fileId: file,
config: req.query?.config ?? 'config', config: req.query?.config ?? 'config',
fileSize: req.body.length, fileSize: req.body.length,