(filePath: string)
| 6 | |
| 7 | export class PdfParser implements FileParser { |
| 8 | async parseFile(filePath: string): Promise<FileParseResult> { |
| 9 | try { |
| 10 | logger.info('Starting to parse file:', filePath) |
| 11 | |
| 12 | if (!filePath) { |
| 13 | throw new Error('No file path provided') |
| 14 | } |
| 15 | |
| 16 | logger.info('Reading file...') |
| 17 | const dataBuffer = await readFile(filePath) |
| 18 | logger.info('File read successfully, size:', dataBuffer.length) |
| 19 | |
| 20 | return this.parseBuffer(dataBuffer) |
| 21 | } catch (error) { |
| 22 | logger.error('Error reading file:', error) |
| 23 | throw error |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | async parseBuffer(dataBuffer: Buffer): Promise<FileParseResult> { |
| 28 | try { |
nothing calls this directly
no test coverage detected