Verbessere Fehlerbehandlung in der Verschlüsselung und PDF-Generierung durch Hinzufügen von Ursacheninformationen
This commit is contained in:
@@ -82,7 +82,7 @@ function decryptLegacyCBC(encryptedData, password) {
|
|||||||
return decrypted.toString('utf8')
|
return decrypted.toString('utf8')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Re-throw mit mehr Kontext
|
// Re-throw mit mehr Kontext
|
||||||
throw new Error(`Legacy CBC Entschlüsselung fehlgeschlagen: ${error.message}`)
|
throw new Error(`Legacy CBC Entschlüsselung fehlgeschlagen: ${error.message}`, { cause: error })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ function decryptV2GCM(encryptedData, password) {
|
|||||||
return decrypted.toString('utf8')
|
return decrypted.toString('utf8')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Re-throw mit mehr Kontext
|
// Re-throw mit mehr Kontext
|
||||||
throw new Error(`GCM v2 Entschlüsselung fehlgeschlagen: ${error.message}`)
|
throw new Error(`GCM v2 Entschlüsselung fehlgeschlagen: ${error.message}`, { cause: error })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ export function encrypt(text, password) {
|
|||||||
return encryptV2GCM(text, password)
|
return encryptV2GCM(text, password)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Verschlüsselungsfehler:', error)
|
console.error('Verschlüsselungsfehler:', error)
|
||||||
throw new Error('Fehler beim Verschlüsseln der Daten')
|
throw new Error('Fehler beim Verschlüsseln der Daten', { cause: error })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ export function decrypt(encryptedData, password) {
|
|||||||
if (error.message.includes('Entschlüsselung fehlgeschlagen')) {
|
if (error.message.includes('Entschlüsselung fehlgeschlagen')) {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
throw new Error(`Fehler beim Entschlüsseln der Daten: ${error.message}`)
|
throw new Error(`Fehler beim Entschlüsseln der Daten: ${error.message}`, { cause: error })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ export class PDFGeneratorService {
|
|||||||
try {
|
try {
|
||||||
await fs.access(this.fallbackTemplatePath)
|
await fs.access(this.fallbackTemplatePath)
|
||||||
return this.fallbackTemplatePath
|
return this.fallbackTemplatePath
|
||||||
} catch (_fallbackError) {
|
} catch (fallbackError) {
|
||||||
throw new Error('No PDF template found')
|
throw new Error('No PDF template found', { cause: fallbackError })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ export async function listSpielplanSeasons() {
|
|||||||
const bySlug = new Map()
|
const bySlug = new Map()
|
||||||
|
|
||||||
for (const directory of directories) {
|
for (const directory of directories) {
|
||||||
let entries = []
|
let entries
|
||||||
try {
|
try {
|
||||||
entries = await fs.readdir(directory)
|
entries = await fs.readdir(directory)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user