mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
97b62e01f8
Avoid logging user content when errors occur in history GitOrigin-RevId: 0326065a15dfc30155847100bb5a077efea771b5
34 lines
793 B
JavaScript
34 lines
793 B
JavaScript
const OError = require('@overleaf/o-error')
|
|
|
|
class UnprocessableError extends OError {}
|
|
|
|
class ApplyError extends UnprocessableError {
|
|
constructor(message, operation, operand) {
|
|
super(message)
|
|
this.operation = operation
|
|
this.operand = operand
|
|
}
|
|
}
|
|
|
|
class InvalidInsertionError extends UnprocessableError {
|
|
constructor(str, operation) {
|
|
super('inserted text contains non BMP characters')
|
|
this.str = str
|
|
this.operation = operation
|
|
}
|
|
}
|
|
|
|
class TooLongError extends UnprocessableError {
|
|
constructor(operation, resultLength) {
|
|
super('resulting string would be too long', { resultLength })
|
|
this.operation = operation
|
|
this.resultLength = resultLength
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
UnprocessableError,
|
|
ApplyError,
|
|
InvalidInsertionError,
|
|
TooLongError,
|
|
}
|