Commit 54c96c8
committed
build: safeguard terminal styling in devkit admin script
Prior to this change, if an unhandled promise rejection or error occurred
that lacked a `stack` property, the `console.error` wrapper in
`devkit-admin.mts` would receive `undefined`. Attempting to pass
`undefined` to Node`s `util.styleText` caused an unexpected
`ERR_INVALID_ARG_TYPE` crash instead of printing the original error.
This commit updates the `console.warn` and `console.error` overrides
to ensure they only apply `styleText` to strings. It also updates the
top-level try-catch block to fallback to the original error object
if `err.stack` is undefined, preventing silent suppression.1 parent a5ab23e commit 54c96c8
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
0 commit comments