overleaf/services/filestore/app/js/Errors.js

31 lines
734 B
JavaScript
Raw Normal View History

2019-12-18 10:01:59 +00:00
const OError = require('@overleaf/o-error')
const { Errors } = require('@overleaf/object-persistor')
2019-12-18 10:01:59 +00:00
2020-04-30 12:20:40 +00:00
class HealthCheckError extends OError {}
class ConversionsDisabledError extends OError {}
class ConversionError extends OError {}
class TimeoutError extends OError {}
class InvalidParametersError extends OError {}
2019-12-18 10:01:59 +00:00
class FailedCommandError extends OError {
constructor(command, code, stdout, stderr) {
2020-04-30 12:20:40 +00:00
super('command failed with error exit code', {
command,
2021-07-13 11:04:46 +00:00
code,
2019-12-18 10:01:59 +00:00
})
this.stdout = stdout
this.stderr = stderr
this.code = code
}
}
module.exports = {
FailedCommandError,
ConversionsDisabledError,
ConversionError,
HealthCheckError,
TimeoutError,
InvalidParametersError,
2021-07-13 11:04:46 +00:00
...Errors,
}