()
| 127 | } |
| 128 | |
| 129 | public async initialize() { |
| 130 | this.logger.debug("Initializing FileSystemSpecService"); |
| 131 | try { |
| 132 | await this.ensureDirectories(); |
| 133 | await this.loadExistingCatalog(); |
| 134 | await this.scanAndSave(this.folderPath); |
| 135 | this.logger.info("Successfully initialized FileSystemSpecService"); |
| 136 | } catch (error) { |
| 137 | this.logger.error( |
| 138 | { error }, |
| 139 | "Failed to initialize FileSystemSpecService" |
| 140 | ); |
| 141 | this.resetState(); |
| 142 | throw new SpecServiceError( |
| 143 | "Failed to initialize FileSystemSpecService", |
| 144 | "INIT_ERROR", |
| 145 | error instanceof Error ? error : new Error(String(error)) |
| 146 | ); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | async scanAndSave(folderPath: string): Promise<void> { |
| 151 | this.logger.debug({ folderPath }, "Starting scan and persist operation"); |
no test coverage detected