Merge pull request #2691 from overleaf/ta-4xx-error-page

Enhance 4xx HTML Response Page

GitOrigin-RevId: 620f84cd6cdc0571bd68bbd2c3164b08f7fe5598
This commit is contained in:
Timothée Alby
2020-04-02 03:19:35 +00:00
committed by Copybot
parent fb2e182d2e
commit 1d7b454c96
7 changed files with 41 additions and 67 deletions
@@ -94,14 +94,17 @@ describe('HttpErrorController', function() {
it('renders HTML with info', function() {
let cause = new Errors.SubscriptionAdminDeletionError()
let error = new HttpErrors.UnprocessableEntityError({}).withCause(cause)
let error = new HttpErrors.UnprocessableEntityError({
info: { public: { message: 'some public message' } }
}).withCause(cause)
this.req.accepts = () => 'html'
this.ErrorController.handleError(error, this.req, this.res)
expect(this.res.statusCode).to.equal(422)
expect(this.res.renderedTemplate).to.equal('general/500')
expect(this.res.renderedTemplate).to.equal('general/400')
expect(this.res.renderedVariables).to.deep.equal({
title: 'Client Error'
title: 'Client Error',
message: 'some public message'
})
})
})