mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user