@edgedev/firebase 2.1.62 → 2.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/edgeFirebase.ts +26 -1
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -606,9 +606,34 @@ export const EdgeFirebase = class {
|
|
|
606
606
|
const userRef = doc(this.db, "staged-users", userRegister.registrationCode);
|
|
607
607
|
userSnap = await getDoc(userRef);
|
|
608
608
|
} catch (error) {
|
|
609
|
+
let errorMessage = error.message
|
|
610
|
+
|
|
611
|
+
switch (error.code) {
|
|
612
|
+
case 'permission-denied':
|
|
613
|
+
errorMessage = "This registration code is no longer valid or has already been used."
|
|
614
|
+
break
|
|
615
|
+
case 'unavailable':
|
|
616
|
+
errorMessage = "Your device or browser could not connect to the registration service. Please check your internet connection or try again using a different browser."
|
|
617
|
+
break
|
|
618
|
+
case 'not-found':
|
|
619
|
+
errorMessage = "This registration code does not exist. Please check for typos or contact support."
|
|
620
|
+
break
|
|
621
|
+
case 'deadline-exceeded':
|
|
622
|
+
errorMessage = "The request timed out. Please try again in a moment, or check your connection."
|
|
623
|
+
break
|
|
624
|
+
case 'internal':
|
|
625
|
+
errorMessage = "Something went wrong in your browser that prevented the registration from completing. Try refreshing or switching browsers."
|
|
626
|
+
break
|
|
627
|
+
case 'resource-exhausted':
|
|
628
|
+
errorMessage = "Too many requests from this device. Please wait a few minutes and try again."
|
|
629
|
+
break
|
|
630
|
+
case 'failed-precondition':
|
|
631
|
+
errorMessage = "Your browser is not supported or is blocking key features required for registration. Try updating or switching browsers."
|
|
632
|
+
break
|
|
633
|
+
}
|
|
609
634
|
return this.sendResponse({
|
|
610
635
|
success: false,
|
|
611
|
-
message:
|
|
636
|
+
message: errorMessage,
|
|
612
637
|
meta: {}
|
|
613
638
|
});
|
|
614
639
|
}
|