Skip to content

Commit

Permalink
handle undefined response in getSecrets error handler (hashicorp#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
mldahl authored and TomNorth committed Mar 25, 2023
1 parent 1b1f02e commit e5f1a49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function getSecrets(secretRequests, client) {
responseCache.set(requestPath, body);
} catch (error) {
const {response} = error;
if (response.statusCode === 404) {
if (response?.statusCode === 404) {
throw Error(`Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`)
}
throw error
Expand Down

0 comments on commit e5f1a49

Please sign in to comment.