Commit 0acb7ae
authored
fix(logging): misleading "settings failed" message aws#7240
## Problem
Misleading log message when a setting returns `null`, even if the caller
specified `defaultValue`:
[error] Settings (amazonQ): failed to read "workspaceIndexCacheDirPath":
Unexpected type cast: got object, expected primitive String
`cast()` considers `null` to be "object" type, which is misleading. If
the caller passed a `defaultValue`, they have intentionally opted-in to
ignoring this situation, and *don't* want this kind of log message.
## Solution
If a setting returns `null|undefined`, skip `cast()` and return
`defaultValue` immediately. Don't log an error message.1 parent 0189564 commit 0acb7ae
File tree
1 file changed
+4
-0
lines changed1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
392 | 396 | | |
393 | 397 | | |
394 | 398 | | |
| |||
0 commit comments