@indietabletop/appkit 3.2.0-6 → 3.2.0-7
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/lib/index.ts +1 -0
- package/lib/knownFailure.ts +9 -0
- package/package.json +1 -1
package/lib/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./async-op.ts";
|
|
|
22
22
|
export * from "./caught-value.ts";
|
|
23
23
|
export * from "./class-names.ts";
|
|
24
24
|
export * from "./client.ts";
|
|
25
|
+
export * from "./knownFailure.ts";
|
|
25
26
|
export * from "./media.ts";
|
|
26
27
|
export * from "./structs.ts";
|
|
27
28
|
export * from "./types.ts";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FailurePayload } from "./types.ts";
|
|
2
|
+
|
|
3
|
+
export function toKnownFailureMessage(failure: FailurePayload) {
|
|
4
|
+
if (failure.type === "NETWORK_ERROR") {
|
|
5
|
+
return "Could not submit form due to network error. Make sure you are connected to the internet and try again.";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return "Could not submit form due to an unexpected error. Please refresh the page and try again.";
|
|
9
|
+
}
|