feat: Update Error Notifications with ComponentsV2 (#14)
Node.js CI / CI (push) Successful in 21s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m41s

## Summary

This PR updates Rosalia's Discord error notifications to use Discord's Components V2 for a beautiful, organized display.

### Changes Made

- **Removed @mention** - Error notifications no longer ping anyone
- **Updated channel** - Notifications now go to the correct channel (1474606829504954511)
- **Implemented ComponentsV2** - Using Container (type 17) with Text Display (type 10) components
- **Visual improvements**:
  - Added accent color (#E91E63) for the container
  - Added separators (type 14) between sections
  - Organized content with headers for scope, message, and stack trace
  - Code blocks for message and stack trace

### Technical Changes

1. **`src/modules/pipeLog.ts`**:
   - Created `PipeErrorOptions` and `DiscordErrorPayloadOptions` interfaces
   - Refactored `pipeError` to accept options object
   - Extracted payload creation into `createDiscordErrorPayload` helper
   - Implemented ComponentsV2 structure with container, text displays, and separators

2. **`src/utils/errorHandler.ts`**:
   - Updated error handler to use new `pipeError` interface

3. **`src/server/serve.ts`**:
   - Updated `/error` webhook endpoint to use new interface

 Created by Hikari~ 🌸

Reviewed-on: #14
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #14.
This commit is contained in:
2026-02-20 20:08:45 -08:00
committed by Naomi Carrigan
parent 46aa662659
commit 9db206ebbc
7 changed files with 195 additions and 46 deletions
+11 -1
View File
@@ -15,7 +15,7 @@ importers:
specifier: 5.2.1
version: 5.2.1
fastify-raw-body:
specifier: ^5.0.0
specifier: 5.0.0
version: 5.0.0
nodemailer:
specifier: 6.10.0
@@ -371,51 +371,61 @@ packages:
resolution: {integrity: sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.34.6':
resolution: {integrity: sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.34.6':
resolution: {integrity: sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.34.6':
resolution: {integrity: sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-loongarch64-gnu@4.34.6':
resolution: {integrity: sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==}
cpu: [loong64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-powerpc64le-gnu@4.34.6':
resolution: {integrity: sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-gnu@4.34.6':
resolution: {integrity: sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-s390x-gnu@4.34.6':
resolution: {integrity: sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.34.6':
resolution: {integrity: sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.34.6':
resolution: {integrity: sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-win32-arm64-msvc@4.34.6':
resolution: {integrity: sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==}