5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-08 23:56:55 +00:00

handle undefined response in getSecrets error handler

This commit is contained in:
Mike Dahl 2023-02-28 14:18:55 -06:00
parent 74bc2a617b
commit a1be2c71f1

View file

@ -40,7 +40,7 @@ async function getSecrets(secretRequests, client) {
responseCache.set(requestPath, body); responseCache.set(requestPath, body);
} catch (error) { } catch (error) {
const {response} = 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(`Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`)
} }
throw error throw error