Make sure that the server builder propagates init errors properly

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-11-11 11:58:33 +01:00
parent f979fcf519
commit a8732a1200
3 changed files with 34 additions and 18 deletions
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/backend-common': patch
---
Make sure that server builder `start()` propagates errors (such as failing to bind to the required port) properly and doesn't resolve the promise prematurely.
After this change, the backend logger will be able to actually capture the error as it happens:
```
2021-11-11T10:54:21.334Z backstage info Initializing http server
2021-11-11T10:54:21.335Z backstage error listen EADDRINUSE: address already in use :::7000 code=EADDRINUSE errno=-48 syscall=listen address=:: port=7000
```