| 176 | } |
| 177 | |
| 178 | export const MIError: MIErrorConstructor = class MIError { |
| 179 | public readonly name: string; |
| 180 | public readonly message: string; |
| 181 | public readonly source: string; |
| 182 | public constructor(message: string, source: string) { |
| 183 | Object.defineProperty(this, 'name', { |
| 184 | get: () => (this.constructor as any).name |
| 185 | }); |
| 186 | Object.defineProperty(this, 'message', { |
| 187 | get: () => message |
| 188 | }); |
| 189 | Object.defineProperty(this, 'source', { |
| 190 | get: () => source |
| 191 | }); |
| 192 | Error.captureStackTrace(this, this.constructor); |
| 193 | } |
| 194 | |
| 195 | public toString() { |
| 196 | return `${this.message} (from ${this.source})`; |
| 197 | } |
| 198 | } as any; |
| 199 | Object.setPrototypeOf(MIError as any, Object.create(Error.prototype)); |
| 200 | MIError.prototype.constructor = MIError; |
nothing calls this directly
no outgoing calls
no test coverage detected