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

37 lines
868 B
JavaScript
Raw Normal View History

2019-12-18 05:01:59 -05:00
const OError = require('@overleaf/o-error')
2020-04-30 08:20:40 -04:00
class NotFoundError extends OError {}
class WriteError extends OError {}
class ReadError extends OError {}
class HealthCheckError extends OError {}
class ConversionsDisabledError extends OError {}
class ConversionError extends OError {}
class SettingsError 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 = {
NotFoundError,
FailedCommandError,
ConversionsDisabledError,
WriteError,
ReadError,
ConversionError,
HealthCheckError,
SettingsError,
TimeoutError,
InvalidParametersError
}