mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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) {
|
} else if (response.statusCode === 403) {
|
||||||
callback(new NotAuthorizedError())
|
callback(new NotAuthorizedError())
|
||||||
|
} else if (response.statusCode === 404) {
|
||||||
|
callback(new CodedError('project not found', 'ProjectNotFound'))
|
||||||
} else {
|
} else {
|
||||||
callback(new WebApiRequestFailedError(response.statusCode))
|
callback(new WebApiRequestFailedError(response.statusCode))
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ describe('joinProject', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return an error', 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) {
|
it('should not have joined the project room', function (done) {
|
||||||
|
|
|
@ -130,8 +130,8 @@ describe('WebApiManager', function () {
|
||||||
this.callback
|
this.callback
|
||||||
.calledWith(
|
.calledWith(
|
||||||
sinon.match({
|
sinon.match({
|
||||||
message: 'non-success status code from web',
|
message: 'project not found',
|
||||||
info: { statusCode: 404 }
|
info: { code: 'ProjectNotFound' }
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
|
|
Loading…
Reference in a new issue