5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-07 15:16:56 +00:00

handle undefined response in getSecrets error handler (#431)

This commit is contained in:
Mike Dahl 2023-03-02 13:39:28 -06:00 committed by GitHub
parent 3bbbc68bd0
commit 256bfb9e6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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