Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More logging on slack hook error #67

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
26 changes: 25 additions & 1 deletion packages/director/src/lib/hooks/reporters/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,31 @@ export async function reportToSlack(
],
icon_url: 'https://sorry-cypress.s3.amazonaws.com/images/logo-bg.png',
},
}).catch((error) => {
}).then(function (response) {
console.log("[CUSTOM] SLACK HOOK SUCESS");
console.log(response.data);
console.log(response.status);
console.log(response.statusText);
console.log(response.headers);
console.log(response.config);
})
.catch((error) => {
console.log("[CUSTOM] SLACK HOOK ERROR");
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
}
getLogger().error(
{ error, ...hook },
`Error while posting Slack message to ${hook.url}`
Expand Down