mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[misc] re-level log: 404 from web -> WARN and emit 'project not found'
A stale browser tab tried to join a deleted project. Emitting 'project not found'/'ProjectNotFound' will trigger a page reload in the frontend, upon web can render a 404. See frontend: ConnectionManager.joinProject callback
This commit is contained in:
parent
55d938ba14
commit
4960bdd6fe
3 changed files with 5 additions and 3 deletions
|
@ -59,6 +59,8 @@ module.exports = {
|
|||
)
|
||||
} else if (response.statusCode === 403) {
|
||||
callback(new NotAuthorizedError())
|
||||
} else if (response.statusCode === 404) {
|
||||
callback(new CodedError('project not found', 'ProjectNotFound'))
|
||||
} else {
|
||||
callback(new WebApiRequestFailedError(response.statusCode))
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ describe('joinProject', function () {
|
|||
})
|
||||
|
||||
it('should return an error', function () {
|
||||
this.error.message.should.equal('Something went wrong in real-time service')
|
||||
this.error.code.should.equal('ProjectNotFound')
|
||||
})
|
||||
|
||||
it('should not have joined the project room', function (done) {
|
||||
|
|
|
@ -130,8 +130,8 @@ describe('WebApiManager', function () {
|
|||
this.callback
|
||||
.calledWith(
|
||||
sinon.match({
|
||||
message: 'non-success status code from web',
|
||||
info: { statusCode: 404 }
|
||||
message: 'project not found',
|
||||
info: { code: 'ProjectNotFound' }
|
||||
})
|
||||
)
|
||||
.should.equal(true)
|
||||
|
|
Loading…
Reference in a new issue