Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions functions/composer-storage-trigger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ exports.triggerDag = async data => {
iap.jwt
);
} catch (err) {
console.error('Error authorizing IAP: ' + err.message);
throw new Error(err);
}
};
Expand Down Expand Up @@ -88,6 +89,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => {
);
const tokenResponse = await res.json();
if (tokenResponse.error) {
console.error('Error in token reponse:' + tokenResponse.error.message);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: use a comma instead of +? (console.error can take two arguments, and this is more idiomatic vs. our other samples.)

return Promise.reject(tokenResponse.error);
}

Expand Down Expand Up @@ -118,6 +120,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => {
);
const blobJson = await blob.json();
if (blobJson.error) {
console.error('Error in blob signing: ' + blobJson.error.message);
return Promise.reject(blobJson.error);
}

Expand All @@ -134,6 +137,7 @@ const authorizeIap = async (clientId, projectId, userAgent) => {
});
const tokenJson = await token.json();
if (tokenJson.error) {
console.error('Error fetching token: ' + tokenJson.error.message);
return Promise.reject(tokenJson.error);
}

Expand Down Expand Up @@ -161,6 +165,7 @@ const makeIapPostRequest = async (url, body, idToken, userAgent) => {

if (!res.ok) {
const err = await res.text();
console.error('Error making IAP post request: ' + err.message);
throw new Error(err);
}
};
Expand Down