Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit ef8bd5f

Browse files
kenskeSilas Boyd-Wickizer
authored and
Silas Boyd-Wickizer
committed
fix(logging): show error on missing property (#87)
The polling function was not outputting an error message when a property is missing from a secret.
1 parent 1ac0694 commit ef8bd5f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/backends/kv-backend.js

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class KVBackend extends AbstractBackend {
3535
this._logger.warn(`Failed to JSON.parse '${value}':`, err)
3636
return
3737
}
38+
39+
if (!(secretProperty.property in parsedValue)) {
40+
throw new Error('Could not find property ' + secretProperty.property + ' in ' + secretProperty.key)
41+
}
42+
3843
return parsedValue[secretProperty.property]
3944
}
4045

lib/poller.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class Poller {
6464
return this._upsertKubernetesSecret({ secretDescriptor })
6565
}))
6666
} catch (err) {
67-
this._logger.error('failure while polling the secrets', err)
67+
this._logger.error('failure while polling the secrets')
68+
this._logger.error(err.toString())
6869
}
6970
}
7071

0 commit comments

Comments
 (0)