Skip to content

Commit 9fbb78a

Browse files
committed
use enum
1 parent 92ab736 commit 9fbb78a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/server/plugins/engine/pageControllers/FileUploadPageController.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ComponentType, type PageFileUpload } from '@defra/forms-model'
22
import Boom from '@hapi/boom'
33
import { wait } from '@hapi/hoek'
4+
import { StatusCodes } from 'http-status-codes'
45
import { type ValidationErrorItem } from 'joi'
56

67
import {
@@ -337,7 +338,10 @@ export class FileUploadPageController extends QuestionPageController {
337338
// expired in CDP, we will get a 404 from the getUploadStatus endpoint.
338339
// In this case we want to initiate a new upload and return that state, so the form
339340
// doesn't blow up for the end user.
340-
if (Boom.isBoom(err) && err.output.statusCode === 404) {
341+
if (
342+
Boom.isBoom(err) &&
343+
err.output.statusCode === StatusCodes.NOT_FOUND.valueOf()
344+
) {
341345
return this.initiateAndStoreNewUpload(request, state)
342346
}
343347
throw err

0 commit comments

Comments
 (0)