Lots of Sentry error handling cleanup (don't log known situations)

* Also fixed duplicated words on multi-dose selection
* Bump rev to 1.9.18
This commit is contained in:
Ryan Slobojan 2021-10-06 13:10:36 -04:00
parent 3ae22de2f1
commit 99c66260a7
5 changed files with 29 additions and 16 deletions

View File

@ -135,7 +135,12 @@ function Form(): JSX.Element {
if (e != undefined) {
console.error(e);
// Don't report known errors to Sentry
if (!e.message.includes('invalidFileType') &&
!e.message.includes('not digitally signed')) {
Sentry.captureException(e);
}
if (e.message != undefined) {
setFileErrorMessage(e.message);
@ -286,12 +291,11 @@ function Form(): JSX.Element {
} catch (e) {
if (e != undefined) {
if (e) {
console.error(e);
Sentry.captureException(e);
if (e.message != undefined) {
if (e.message) {
setAddErrorMessage(e.message);
} else {
setAddErrorMessage("Unable to continue.");
@ -299,10 +303,9 @@ function Form(): JSX.Element {
} else {
setAddErrorMessage("Unexpected error. Sorry.");
}
setSaveLoading(false);
setSaveLoading(false);
}
}
@ -348,7 +351,9 @@ function Form(): JSX.Element {
setSaveLoading(false);
} catch (e) {
Sentry.captureException(e);
setAddErrorMessage(e.message);
setSaveLoading(false);
}

View File

@ -36,7 +36,7 @@ function Page(props: PageProps): JSX.Element {
<a href="https://github.com/billylo1/covidpass" className="underline">{t('common:gitHub')}</a>
<a href="https://vaccine-ontario.ca" className="underline">{t('common:returnToMainSite')}</a>
</nav>
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-10-05 (v1.9.15)</div>
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-10-06 (v1.9.18)</div>
</footer>
</main>
</div>

View File

@ -15,7 +15,7 @@ ontarioHealth: Ontario Ministry of Health
gotoOntarioHealth: Go to Ontario Ministry of Health
downloadSignedPDF: and enter your information to display your official vaccination receipt. Press the Share Icon at the bottom, "Save As Files" to store it onto your iPhone.
reminderNotToRepeat: If you have completed this step before, simply proceed to Step 2.
formatChange: After the recent vaccination receipt formatting change, both doses are included in the same file. Please select which dose you which dose you want to save.
formatChange: After the recent vaccination receipt formatting change, both doses are included in the same file. Please select which dose you want to save.
saveMultiple: To save multiple receipts, please select the first one you want to save and click the Wallet or Photo button below, then change which dose is selected here and push the button again to generate another Wallet or Photo for another dose.
pickColor: Pick a Color
pickColorDescription: Pick a background color for your pass.

View File

@ -154,16 +154,18 @@ async function loadPDF(fileBuffer : ArrayBuffer): Promise<HashTable<Receipt>> {
return Promise.reject(`invalid certificate + ${JSON.stringify(result)}`);
}
} catch (e) {
console.error(e);
if (e.message.includes('Failed to locate ByteRange')) {
if (e.message.includes('Failed to locate ByteRange') ||
e.message.includes('read ASN.1') ||
e.message.includes('Failed byte range verification')) {
e.message = 'Sorry. Selected PDF file is not digitally signed. Please download official copy from Step 1 and retry. Thanks.'
} else {
if (!e.message.includes('cancelled')) {
console.error(e);
Sentry.captureException(e);
}
}
return Promise.reject(e);
}
}
@ -210,7 +212,9 @@ async function getPdfDetails(fileBuffer: ArrayBuffer): Promise<HashTable<Receipt
return Promise.resolve(receiptObj);
} catch (e) {
if (e && e.message && !e.message.includes('cancelled')) {
Sentry.captureException(e);
}
return Promise.reject(e);
}
}

View File

@ -3,11 +3,15 @@ import { Integrations } from '@sentry/tracing';
export const initSentry = () => {
SentryModule.init({
release: 'grassroots_covidpass@1.9.15', // App version. Needs to be manually updated as we go unless we make the build smarter
release: 'grassroots_covidpass@1.9.18', // App version. Needs to be manually updated as we go unless we make the build smarter
dsn: 'https://7120dcf8548c4c5cb148cdde2ed6a778@o1015766.ingest.sentry.io/5981424',
integrations: [
new Integrations.BrowserTracing(),
],
ignoreErrors: [
'cancelled',
'invalidFileType'
],
attachStacktrace: true,
tracesSampleRate: 0.5