mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
Merge pull request #2985 from overleaf/msm-oerror-remove-unprocessable-entity-error
Replace UnprocessableEntityError with calls to unprocessableEntity() handler GitOrigin-RevId: 4bba389c8cdf87a40137d49db571fa81aaac4239
This commit is contained in:
@@ -13,6 +13,7 @@ const UserSessionsManager = require('./UserSessionsManager')
|
||||
const UserUpdater = require('./UserUpdater')
|
||||
const SudoModeHandler = require('../SudoMode/SudoModeHandler')
|
||||
const Errors = require('../Errors/Errors')
|
||||
const HttpErrorHandler = require('../Errors/HttpErrorHandler')
|
||||
const OError = require('@overleaf/o-error')
|
||||
const HttpErrors = require('@overleaf/o-error/http')
|
||||
const EmailHandler = require('../Email/EmailHandler')
|
||||
@@ -108,10 +109,12 @@ const UserController = {
|
||||
errorData.info.public = {
|
||||
error: 'SubscriptionAdminDeletionError'
|
||||
}
|
||||
return next(
|
||||
new HttpErrors.UnprocessableEntityError(errorData).withCause(
|
||||
err
|
||||
)
|
||||
logger.warn(new OError(errorData).withCause(err))
|
||||
return HttpErrorHandler.unprocessableEntity(
|
||||
req,
|
||||
res,
|
||||
errorData.message,
|
||||
errorData.info.public
|
||||
)
|
||||
} else {
|
||||
return next(new OError(errorData).withCause(err))
|
||||
|
||||
Reference in New Issue
Block a user