mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-03-23 04:25:24 +00:00
Use typed error to report inspection problems
This will throw a typed error in case when supervisor cannot inspect its own container. Change-type: patch Signed-off-by: Roman Mazur <roman@balena.io>
This commit is contained in:
parent
4846acb25e
commit
4b56022d93
@ -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 {}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user