mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #2988 from overleaf/msm-oerror-remove-not-found-error
Replace HTTPErrors.NotFoundError with calls to notFound() handler GitOrigin-RevId: c98582a5bd3d862b3c17fb03d863c75f64851aba
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
const HttpErrors = require('@overleaf/o-error/http')
|
||||
const ProjectDeleter = require('../Project/ProjectDeleter')
|
||||
const EditorController = require('./EditorController')
|
||||
const ProjectGetter = require('../Project/ProjectGetter')
|
||||
@@ -269,9 +268,7 @@ async function convertDocToFile(req, res, next) {
|
||||
res.json({ fileId: fileRef._id.toString() })
|
||||
} catch (err) {
|
||||
if (err instanceof Errors.NotFoundError) {
|
||||
throw new HttpErrors.NotFoundError({
|
||||
info: { public: { message: 'Document not found' } }
|
||||
})
|
||||
return HttpErrorHandler.notFound(req, res, 'Document not found')
|
||||
} else if (err instanceof Errors.DocHasRangesError) {
|
||||
return HttpErrorHandler.unprocessableEntity(
|
||||
req,
|
||||
|
||||
Reference in New Issue
Block a user