Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleError(error: any) {
// const appRef = this.injector.get(ApplicationRef);
if (error instanceof HttpErrorResponse) {
debug.error('Backend returned status code: ', error.status);
debug.error('Response body:', error.message);
} else {
const notifyService = this.injector.get(NotifyService);
const errorMessage = error.message ? error.message : error.toString();
const issueTitle = `Bug: Application error: ${errorMessage}`;
const issueBody = `Error message: ${errorMessage}\n\nError stack:\n\n\`\`\`\n${error.stack}\n\`\`\``;
const issueUrl = newGithubIssueUrl({
user: 'imolorhe',
repo: 'altair',
title: issueTitle,
body: issueBody,
labels: [ 'bug-report' ],
template: 'Bug_report.md',
});
debug.error('Application error:', errorMessage);
notifyService.error(`An error occured: ${errorMessage}`);
notifyService.warning(`If you think this is a bug, click here to report the bug.`, 'Altair', {
disableTimeOut: true,
data: {
url: issueUrl,
}
});
}
export default function createZapIssueTemplate({ title, body, labels, productName, version }) {
return newGithubIssueUrl({
user: 'LN-Zap',
repo: 'zap-desktop',
title,
labels,
body: `Detailed Description\n-------\n\`\`${body}\`\`
\nYour Environment\n----\n- Zap version: ${productName} ${version}`,
})
}