|
|
|
@ -259,8 +259,12 @@ export class Application extends Container {
|
|
|
|
|
try {
|
|
|
|
|
await this.up()
|
|
|
|
|
await this.down()
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.errorHandler(e)
|
|
|
|
|
} catch (e: unknown) {
|
|
|
|
|
if ( e instanceof Error ) {
|
|
|
|
|
this.errorHandler(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw e
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -306,9 +310,14 @@ export class Application extends Container {
|
|
|
|
|
await unit.up()
|
|
|
|
|
unit.status = UnitStatus.Started
|
|
|
|
|
logging.info(`Started ${unit.constructor.name}.`)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
} catch (e: unknown) {
|
|
|
|
|
unit.status = UnitStatus.Error
|
|
|
|
|
throw this.errorWrapContext(e, {unitName: unit.constructor.name})
|
|
|
|
|
|
|
|
|
|
if ( e instanceof Error ) {
|
|
|
|
|
throw this.errorWrapContext(e, {unitName: unit.constructor.name})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw e
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -327,7 +336,12 @@ export class Application extends Container {
|
|
|
|
|
logging.info(`Stopped ${unit.constructor.name}.`)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
unit.status = UnitStatus.Error
|
|
|
|
|
throw this.errorWrapContext(e, {unitName: unit.constructor.name})
|
|
|
|
|
|
|
|
|
|
if ( e instanceof Error ) {
|
|
|
|
|
throw this.errorWrapContext(e, {unitName: unit.constructor.name})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw e
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|