From a1be2c71f1676c16dd713e473b7890ae738657b1 Mon Sep 17 00:00:00 2001 From: Mike Dahl Date: Tue, 28 Feb 2023 14:18:55 -0600 Subject: [PATCH] handle undefined response in getSecrets error handler --- src/secrets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/secrets.js b/src/secrets.js index 875249b4..45b26e0a 100644 --- a/src/secrets.js +++ b/src/secrets.js @@ -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