Skip to content

Instantly share code, notes, and snippets.

@ram4git
Created July 22, 2021 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ram4git/efd9c381e4739e35dc3ef01af3f42f0d to your computer and use it in GitHub Desktop.
Save ram4git/efd9c381e4739e35dc3ef01af3f42f0d to your computer and use it in GitHub Desktop.
export const reportException = async (exception, reportToAppCenter = true) => {
const {appVersion, label} = await codePush.getUpdateMetadata() || {};
try {
if (reportToAppCenter) {
Analytics.trackEvent(`Exception Occured ===> ${exception}`);
}
} catch {
}
try {
const uri =
'https://hooks.slack.com/services/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';
const body = {
channel: '#lunchwale-exceptions',
username: 'ExceptionBot',
text: `[${appVersion}/${label}] => ${eventMessage}`,
icon_emoji: ':confounded:',
};
await handleApiCall(uri, 'POST', body);
} catch {
}
};
@ram4git
Copy link
Author

ram4git commented Jul 22, 2021

//TODO do a primary tutorial on async/await or Javascript Promises
// https://www.youtube.com/watch?v=Bv_5Zv5c-Ts
// event loop https://www.youtube.com/watch?v=cCOL7MC4Pl0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment