diff --git a/src/lib/errors.ts b/src/lib/errors.ts index 4abcd168..8a5d2d64 100644 --- a/src/lib/errors.ts +++ b/src/lib/errors.ts @@ -62,3 +62,9 @@ export class ConfigurationValidationError extends TypedError { } export class ImageAuthenticationError extends TypedError {} + +/** + * An error thrown if our own container cannot be inspected. + * See LocalModeManager for a usage example. + */ +export class SupervisorContainerNotFoundError extends TypedError {} diff --git a/src/local-mode.ts b/src/local-mode.ts index efa9b78a..f4e47308 100644 --- a/src/local-mode.ts +++ b/src/local-mode.ts @@ -5,6 +5,7 @@ import * as _ from 'lodash'; import Config from './config'; import Database from './db'; import * as constants from './lib/constants'; +import { SupervisorContainerNotFoundError } from './lib/errors'; import log from './lib/supervisor-console'; import { Logger } from './logger'; @@ -176,7 +177,7 @@ export class LocalModeManager { ); return this.collectContainerResources(fallback); } - throw e; + throw new SupervisorContainerNotFoundError(e); } }