mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
handle custom errors created without info
This commit is contained in:
@@ -95,6 +95,17 @@ describe('errorType.Error', () => {
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
it('handles a custom error without info', () => {
|
||||
try {
|
||||
throw new CustomError1({})
|
||||
expect.fail('should have thrown')
|
||||
} catch (e) {
|
||||
expect(errorType.getFullInfo(e)).to.deep.equal({})
|
||||
let infoKey = Object.keys(e).find(k => k === 'info')
|
||||
expect(infoKey).to.not.exist
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('errorType.ErrorWithStatusCode', () => {
|
||||
|
||||
Reference in New Issue
Block a user