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

31 lines
732 B
JavaScript
Raw Normal View History

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