Revert "fix: resolve all ESLint errors in backend and frontend"
Build and Push Multi-Platform Images / build-and-push (push) Successful in 19s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 19s
This reverts commit 07dfd7e840.
This commit is contained in:
@@ -16,7 +16,6 @@ import { EmailImportService } from './email-import.service';
|
||||
import { EmailPageCacheService } from './email-page-cache.service';
|
||||
import { RequirePermissions } from '../auth/permissions.decorator';
|
||||
import { Permission } from '../auth/permissions.enum';
|
||||
import { getErrorMessage } from '../common/error.util';
|
||||
|
||||
@Controller('api/email-import')
|
||||
export class EmailImportController {
|
||||
@@ -132,14 +131,9 @@ export class EmailImportController {
|
||||
`inline; filename="preview-${attachmentId}.pdf"`,
|
||||
);
|
||||
res.send(pdfBuffer);
|
||||
} catch (err: unknown) {
|
||||
this.logger.error(
|
||||
`Error generating print preview: ${getErrorMessage(err)}`,
|
||||
);
|
||||
throw new HttpException(
|
||||
getErrorMessage(err),
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
} catch (err: any) {
|
||||
this.logger.error(`Error generating print preview: ${err.message}`);
|
||||
throw new HttpException(err.message, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,12 +185,9 @@ export class EmailImportController {
|
||||
try {
|
||||
const result = await this.importService.executeImport(importData);
|
||||
return result;
|
||||
} catch (err: unknown) {
|
||||
this.logger.error(`Error executing import: ${getErrorMessage(err)}`);
|
||||
throw new HttpException(
|
||||
getErrorMessage(err),
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
} catch (err: any) {
|
||||
this.logger.error(`Error executing import: ${err.message}`);
|
||||
throw new HttpException(err.message, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs/promises';
|
||||
import * as crypto from 'crypto';
|
||||
import { getErrorMessage } from '../common/error.util';
|
||||
|
||||
@Injectable()
|
||||
export class EmailImportService {
|
||||
@@ -81,9 +80,9 @@ export class EmailImportService {
|
||||
await this.attachmentRepo.save(attachment);
|
||||
|
||||
await this.pdfService.cleanup(images);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.warn(
|
||||
`Fehler bei on-demand Vorschau-Generierung für Anhang ${attachment.Id}: ${getErrorMessage(err)}`,
|
||||
`Fehler bei on-demand Vorschau-Generierung für Anhang ${attachment.Id}: ${err.message}`,
|
||||
);
|
||||
} finally {
|
||||
await fs.unlink(tempPdfPath).catch(() => {});
|
||||
@@ -157,12 +156,11 @@ export class EmailImportService {
|
||||
|
||||
this.logger.debug(`Received Belegnummer: ${result}`);
|
||||
return String(result);
|
||||
} catch (error: unknown) {
|
||||
const axiosErr = axios.isAxiosError(error) ? error : undefined;
|
||||
const status = axiosErr?.response?.status ?? 'UNKNOWN';
|
||||
const detail = axiosErr?.response?.data
|
||||
? JSON.stringify(axiosErr.response.data)
|
||||
: getErrorMessage(error);
|
||||
} catch (error: any) {
|
||||
const status = error.response?.status || 'UNKNOWN';
|
||||
const detail = error.response?.data
|
||||
? JSON.stringify(error.response.data)
|
||||
: error.message;
|
||||
this.logger.error(
|
||||
`Failed to fetch Belegnummer from ${url}. Status: ${status}, Detail: ${detail}`,
|
||||
);
|
||||
@@ -193,9 +191,9 @@ export class EmailImportService {
|
||||
`Releasing Belegnummer: ${cleanNumber} (original: ${number}) via ${url}`,
|
||||
);
|
||||
await axios.get(url);
|
||||
} catch (error: unknown) {
|
||||
} catch (error: any) {
|
||||
this.logger.error(
|
||||
`Failed to release Belegnummer at ${url}: ${getErrorMessage(error)}`,
|
||||
`Failed to release Belegnummer at ${url}: ${error.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -217,9 +215,9 @@ export class EmailImportService {
|
||||
`Setting Belegnummer: ${cleanNumber} (original: ${number}) via ${url}`,
|
||||
);
|
||||
await axios.get(url);
|
||||
} catch (error: unknown) {
|
||||
} catch (error: any) {
|
||||
this.logger.error(
|
||||
`Failed to set Belegnummer at ${url}: ${getErrorMessage(error)}`,
|
||||
`Failed to set Belegnummer at ${url}: ${error.message}`,
|
||||
);
|
||||
throw new HttpException(
|
||||
'Fehler beim Setzen der Belegnummer',
|
||||
@@ -612,9 +610,7 @@ export class EmailImportService {
|
||||
docId = statusObj.related_document;
|
||||
break;
|
||||
}
|
||||
} catch {
|
||||
// Task-Status nicht parsebar: nächsten Versuch abwarten
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (docId) {
|
||||
@@ -633,10 +629,7 @@ export class EmailImportService {
|
||||
// Confirm Belegnummer if used
|
||||
if (att.belegnummer && att.barcode?.nummer) {
|
||||
await this.setBelegnummer(data.emailDate, att.barcode.nummer).catch(
|
||||
(e) =>
|
||||
this.logger.warn(
|
||||
`Failed to set Belegnummer: ${getErrorMessage(e)}`,
|
||||
),
|
||||
(e) => this.logger.warn(`Failed to set Belegnummer: ${e.message}`),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ConfigService } from '@nestjs/config';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs/promises';
|
||||
import sharp from 'sharp';
|
||||
import { getErrorMessage } from '../common/error.util';
|
||||
|
||||
const THUMBNAIL_WIDTH = 180;
|
||||
|
||||
@@ -56,9 +55,9 @@ export class EmailPageCacheService {
|
||||
.resize({ width: THUMBNAIL_WIDTH })
|
||||
.png()
|
||||
.toFile(thumbDest);
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.warn(
|
||||
`E-Mail Page Cache fehlgeschlagen (Attachment ${attachmentId} Seite ${page}): ${getErrorMessage(err)}`,
|
||||
`E-Mail Page Cache fehlgeschlagen (Attachment ${attachmentId} Seite ${page}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import { Content } from '../database/entities/content.entity';
|
||||
import { PaperlessService } from '../paperless/paperless.service';
|
||||
import { RequirePermissions } from '../auth/permissions.decorator';
|
||||
import { Permission } from '../auth/permissions.enum';
|
||||
import { getErrorMessage, getErrorStack } from '../common/error.util';
|
||||
|
||||
@Controller('api/emails')
|
||||
export class EmailController {
|
||||
@@ -174,10 +173,10 @@ export class EmailController {
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
`Fehler bei Checksummen-Prüfung für Attachment ${attachment.Id}: ${getErrorMessage(err)}`,
|
||||
getErrorStack(err),
|
||||
`Fehler bei Checksummen-Prüfung für Attachment ${attachment.Id}: ${err.message}`,
|
||||
err.stack,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -204,10 +203,10 @@ export class EmailController {
|
||||
`Prüfung abgeschlossen. ${updatedCount} E-Mails aktualisiert, ${idsUpdated} Paperless-IDs ergänzt, ${skippedCount} übersprungen.`,
|
||||
);
|
||||
return { updatedCount, idsUpdated };
|
||||
} catch (error: unknown) {
|
||||
} catch (error: any) {
|
||||
this.logger.error(
|
||||
`Kritischer Fehler bei checkAttachments: ${getErrorMessage(error)}`,
|
||||
getErrorStack(error),
|
||||
`Kritischer Fehler bei checkAttachments: ${error.message}`,
|
||||
error.stack,
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user