errors: add explicit name property to ServiceUnavailableError

Every CustomErrorBase subclass explicitly sets `name = 'ClassName' as const`
except ServiceUnavailableError, which relied on the constructor fallback that
reads `this.constructor.name`. This is fragile under minification. Added the
explicit name property for consistency and added a serialization round-trip test.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-04-15 12:20:33 +02:00
parent a54350bc5b
commit 8741e5a800
4 changed files with 23 additions and 3 deletions
@@ -0,0 +1,5 @@
---
'@backstage/errors': patch
---
Added explicit `name` property to `ServiceUnavailableError` for consistency with all other error classes, making it resilient to minification.