fix(andreknie.de): close data lifecycle review gaps
This commit is contained in:
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url'
|
||||
import { Mutex } from 'async-mutex'
|
||||
import { resourceLimiter } from '../middleware/rateLimiter.js'
|
||||
import { antiSpam } from '../middleware/antiSpam.js'
|
||||
import { sendSpeakerCv } from '../services/mailer.js'
|
||||
import { sendSpeakerCv, MailerNotReadyError } from '../services/mailer.js'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const LEADS_FILE = join(__dirname, '..', 'data', 'speaker-cv-leads.json')
|
||||
@@ -51,8 +51,8 @@ router.post('/', resourceLimiter, antiSpam, async (req, res) => {
|
||||
})
|
||||
|
||||
res.status(201).json({ ok: true, message: 'Danke! Der Speaker CV ist auf dem Weg in dein Postfach.' })
|
||||
} catch {
|
||||
res.status(503).json({ error: 'Der Versand ist derzeit nicht verfügbar.' })
|
||||
} catch (error) {
|
||||
res.status(error instanceof MailerNotReadyError ? 503 : 502).json({ error: 'Der Versand ist derzeit nicht verfügbar.' })
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user