ActivationError.ts
36 lines
| 1005 B
| video/mp2t
|
TypeScriptLexer
|
|
r34 | import { ActivationContextInfo } from "./ActivationContext"; | ||
| export class ActivationError { | ||||
|
|
r39 | activationStack: ActivationContextInfo[]; | ||
|
|
r34 | |||
|
|
r39 | service: string; | ||
|
|
r34 | |||
|
|
r39 | innerException: any; | ||
|
|
r34 | |||
|
|
r39 | message: string; | ||
|
|
r34 | |||
| constructor(service: string, activationStack: ActivationContextInfo[], innerException) { | ||||
| this.message = "Failed to activate the service"; | ||||
| this.activationStack = activationStack; | ||||
| this.service = service; | ||||
| this.innerException = innerException; | ||||
| } | ||||
| toString() { | ||||
|
|
r39 | const parts = [this.message]; | ||
|
|
r34 | if (this.service) | ||
| parts.push("when activating: " + this.service.toString()); | ||||
| if (this.innerException) | ||||
| parts.push("caused by: " + this.innerException.toString()); | ||||
| if (this.activationStack) { | ||||
| parts.push("at"); | ||||
|
|
r39 | this.activationStack | ||
| .forEach(x => parts.push(` ${x.name} ${x.service ? x.service.toString() : ""}`)); | ||||
|
|
r34 | } | ||
| return parts.join("\n"); | ||||
| } | ||||
|
|
r39 | } | ||
