Merge pull request #2661 from overleaf/em-convert-doc-to-file-ranges

Do not convert a doc to file when it has ranges

GitOrigin-RevId: 52f0151e54c426178f80c34c6afac908bbf7b90d
This commit is contained in:
Eric Mc Sween
2020-03-10 08:36:53 -04:00
committed by Copybot
parent 403704710c
commit 8547bb3c8d
5 changed files with 180 additions and 110 deletions

View File

@@ -241,6 +241,12 @@ async function convertDocToFile(req, res, next) {
throw new HttpErrors.NotFoundError({
info: { public: { message: 'Document not found' } }
})
} else if (err instanceof Errors.DocHasRangesError) {
throw new HttpErrors.UnprocessableEntityError({
info: {
public: { message: 'Document has comments or tracked changes' }
}
})
} else {
throw err
}