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

Commit

Permalink
fix(logging): show error on missing property (#87)
Browse files Browse the repository at this point in the history
The polling function was not outputting an error message when a property is missing from a secret.
  • Loading branch information
kenske authored and Silas Boyd-Wickizer committed Jun 6, 2019
1 parent 1ac0694 commit ef8bd5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/backends/kv-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class KVBackend extends AbstractBackend {
this._logger.warn(`Failed to JSON.parse '${value}':`, err)
return
}

if (!(secretProperty.property in parsedValue)) {
throw new Error('Could not find property ' + secretProperty.property + ' in ' + secretProperty.key)
}

return parsedValue[secretProperty.property]
}

Expand Down
3 changes: 2 additions & 1 deletion lib/poller.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class Poller {
return this._upsertKubernetesSecret({ secretDescriptor })
}))
} catch (err) {
this._logger.error('failure while polling the secrets', err)
this._logger.error('failure while polling the secrets')
this._logger.error(err.toString())
}
}

Expand Down

0 comments on commit ef8bd5f

Please sign in to comment.