mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
[monorepo] remove PII and variables from error messages (#31508)
* [monorepo] remove PII and variables from error messages Exclusions: - scripts - tests - fuzzing - SplitTestManager (messages are sent to admin frontend) - Group setup (we may want an error per unique tuple) - sharejs (unused types; text type errors are shadowed already) - history-v1 error messages that are used by the ErrorRecorder - errors that flag issues with configuration/call signatures I've used these search terms for finding unwanted error messages: - new Error(` - new Error\(\n\s+` (regex search) - new OError(` - new OError\(\n\s+` (regex search) * [web] throw NotFoundError from ProjectLocator * [github-sync] fix OError.tag call in script Co-authored-by: Jessica Lawshe <jessica.lawshe@overleaf.com> * [templates] revert changes to test client --------- Co-authored-by: Jessica Lawshe <jessica.lawshe@overleaf.com> GitOrigin-RevId: 736857a4fc5d9bfb0f8cb03e0f004eda87e5a220
This commit is contained in:
@@ -55,10 +55,9 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should not perform and update on mongo if it is not a recognised compiler', async function (ctx) {
|
||||
const fakeComplier = 'something'
|
||||
expect(
|
||||
await expect(
|
||||
ctx.handler.promises.setCompiler(projectId, 'something')
|
||||
).to.be.rejectedWith(`invalid compiler: ${fakeComplier}`)
|
||||
).to.be.rejectedWith('invalid compiler')
|
||||
|
||||
ctx.projectModel.updateOne.called.should.equal(false)
|
||||
})
|
||||
@@ -76,8 +75,8 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should be rejected', async function (ctx) {
|
||||
expect(ctx.handler.promises.setCompiler(projectId, 'xeLaTeX')).to.be
|
||||
.rejected
|
||||
await expect(ctx.handler.promises.setCompiler(projectId, 'xeLaTeX')).to
|
||||
.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -92,9 +91,9 @@ describe('ProjectOptionsHandler', function () {
|
||||
|
||||
it('should not perform and update on mongo if it is not a reconised image name', async function (ctx) {
|
||||
const fakeImageName = 'something'
|
||||
expect(
|
||||
await expect(
|
||||
ctx.handler.promises.setImageName(projectId, fakeImageName)
|
||||
).to.be.rejectedWith(`invalid imageName: ${fakeImageName}`)
|
||||
).to.be.rejectedWith('invalid imageName')
|
||||
|
||||
ctx.projectModel.updateOne.called.should.equal(false)
|
||||
})
|
||||
@@ -112,8 +111,9 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should be rejected', async function (ctx) {
|
||||
expect(ctx.handler.promises.setImageName(projectId, 'texlive-1234.5'))
|
||||
.to.be.rejected
|
||||
await expect(
|
||||
ctx.handler.promises.setImageName(projectId, 'texlive-1234.5')
|
||||
).to.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -128,9 +128,9 @@ describe('ProjectOptionsHandler', function () {
|
||||
|
||||
it('should not perform and update on mongo if it is not a reconised langauge', async function (ctx) {
|
||||
const fakeLanguageCode = 'not a lang'
|
||||
expect(
|
||||
await expect(
|
||||
ctx.handler.promises.setSpellCheckLanguage(projectId, fakeLanguageCode)
|
||||
).to.be.rejectedWith(`invalid languageCode: ${fakeLanguageCode}`)
|
||||
).to.be.rejectedWith('invalid languageCode')
|
||||
ctx.projectModel.updateOne.called.should.equal(false)
|
||||
})
|
||||
|
||||
@@ -145,8 +145,8 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should be rejected', async function (ctx) {
|
||||
expect(ctx.handler.promises.setSpellCheckLanguage(projectId)).to.be
|
||||
.rejected
|
||||
await expect(ctx.handler.promises.setSpellCheckLanguage(projectId)).to
|
||||
.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -175,8 +175,8 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should be rejected', async function (ctx) {
|
||||
expect(ctx.handler.promises.setBrandVariationId(projectId, '123')).to.be
|
||||
.rejected
|
||||
await expect(ctx.handler.promises.setBrandVariationId(projectId, '123'))
|
||||
.to.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -197,8 +197,9 @@ describe('ProjectOptionsHandler', function () {
|
||||
})
|
||||
|
||||
it('should be rejected', async function (ctx) {
|
||||
expect(ctx.handler.promises.setHistoryRangesSupport(projectId, true)).to
|
||||
.be.rejected
|
||||
await expect(
|
||||
ctx.handler.promises.setHistoryRangesSupport(projectId, true)
|
||||
).to.be.rejected
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user