##// END OF EJS Templates
WIP service descriptors
WIP service descriptors

File last commit:

r9:988f0f6aab67 default
r13:dc3d64c43573 default
Show More
ActivationError.ts
60 lines | 1.5 KiB | video/mp2t | TypeScriptLexer
/ src / main / ts / ActivationError.ts
cin
initial commit
r0 export interface ActivationItem {
name: string;
service: string;
}
cin
almost woking typings
r9 /**
* Contains information about the error which occurred during service activation.
*
* Information about activation error includes original exception which has
* occurred, the name of the service being activated and activation stack of
* services.
*/
cin
initial commit
r0 export class ActivationError {
cin
almost woking typings
r9 /**
* Stack of services being activating
*/
cin
Removed ContextResolver, added DescriptoBuilder.wants(...), dependencies are declared statically
r4 readonly activationStack: ActivationItem[];
cin
initial commit
r0
cin
almost woking typings
r9 /**
* The name of the failed service
*/
cin
Removed ContextResolver, added DescriptoBuilder.wants(...), dependencies are declared statically
r4 readonly service: string;
cin
initial commit
r0
cin
almost woking typings
r9 /**
* The exception which occurred during activation of the service
*/
cin
Removed ContextResolver, added DescriptoBuilder.wants(...), dependencies are declared statically
r4 readonly innerException: unknown;
cin
initial commit
r0
cin
almost woking typings
r9 /**
* Error message
*/
cin
Removed ContextResolver, added DescriptoBuilder.wants(...), dependencies are declared statically
r4 readonly message: string;
cin
initial commit
r0
cin
working on fluent configuration
r1 constructor(service: string, activationStack: ActivationItem[], innerException: unknown) {
cin
initial commit
r0 this.message = "Failed to activate the service";
this.activationStack = activationStack;
this.service = service;
this.innerException = innerException;
}
toString() {
const parts = [this.message];
if (this.service)
cin
working on fluent configuration
r1 parts.push(`when activating: ${String(this.service)}`);
cin
initial commit
r0
if (this.innerException)
cin
working on fluent configuration
r1 parts.push(`caused by: ${String(this.innerException)}`);
cin
initial commit
r0
if (this.activationStack) {
parts.push("at");
cin
working on fluent configuration
r1 parts.push.apply(null,
this.activationStack
.map(({ name, service }) => ` ${name} ${service}`)
);
cin
initial commit
r0
}
return parts.join("\n");
}
}