File tree Expand file tree Collapse file tree
src/server/plugins/engine/pageControllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ComponentType , type PageFileUpload } from '@defra/forms-model'
22import Boom from '@hapi/boom'
33import { wait } from '@hapi/hoek'
4+ import { StatusCodes } from 'http-status-codes'
45import { type ValidationErrorItem } from 'joi'
56
67import {
@@ -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
You can’t perform that action at this time.
0 commit comments