mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Merge pull request #1011 from sharelatex/ew-add-account-merge-error
add account merge error
This commit is contained in:
@@ -13,6 +13,11 @@ module.exports = ErrorController =
|
||||
res.render 'general/500',
|
||||
title: "Server Error"
|
||||
|
||||
accountMergeError: (req, res)->
|
||||
res.status(500)
|
||||
res.render 'general/account-merge-error',
|
||||
title: "Account Access Error"
|
||||
|
||||
handleError: (error, req, res, next) ->
|
||||
user = AuthenticationController.getSessionUser(req)
|
||||
if error?.code is 'EBADCSRFTOKEN'
|
||||
@@ -33,6 +38,9 @@ module.exports = ErrorController =
|
||||
logger.warn {err: error, url: req.url}, "invalid name error"
|
||||
res.status(400)
|
||||
res.send(error.message)
|
||||
else if error instanceof Errors.AccountMergeError
|
||||
logger.error err: error, "account merge error"
|
||||
ErrorController.accountMergeError req, res
|
||||
else
|
||||
logger.error err: error, url:req.url, method:req.method, user:user, "error passed to top level next middlewear"
|
||||
ErrorController.serverError req, res
|
||||
|
||||
@@ -89,6 +89,13 @@ InvalidError = (message) ->
|
||||
return error
|
||||
InvalidError.prototype.__proto__ = Error.prototype
|
||||
|
||||
AccountMergeError = (message) ->
|
||||
error = new Error(message)
|
||||
error.name = "AccountMergeError"
|
||||
error.__proto__ = AccountMergeError.prototype
|
||||
return error
|
||||
AccountMergeError.prototype.__proto__ = Error.prototype
|
||||
|
||||
module.exports = Errors =
|
||||
NotFoundError: NotFoundError
|
||||
ServiceNotConfiguredError: ServiceNotConfiguredError
|
||||
@@ -103,3 +110,4 @@ module.exports = Errors =
|
||||
UnconfirmedEmailError: UnconfirmedEmailError
|
||||
EmailExistsError: EmailExistsError
|
||||
InvalidError: InvalidError
|
||||
AccountMergeError: AccountMergeError
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
.content.content-alt
|
||||
.container
|
||||
.row
|
||||
.col-md-6.col-md-offset-3
|
||||
.card
|
||||
.page-header
|
||||
h1 Account Access Error
|
||||
p.text-danger Sorry, an error occurred accessing your account. Please #[a(href="" ng-controller="ContactModal" ng-click="contactUsModal()") contact support] and provide any email addresses that you have used to sign in to Overleaf and/or ShareLaTeX for assistance.
|
||||
Reference in New Issue
Block a user