From 5c81502a507c2034e79086c34619df90d0763102 Mon Sep 17 00:00:00 2001
From: Aadi Desai <21363892+supleed2@users.noreply.github.com>
Date: Mon, 13 Nov 2023 00:34:58 +0000
Subject: [PATCH] Add error page
---
error.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++
error.js | 33 +++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100644 error.html
create mode 100644 error.js
diff --git a/error.html b/error.html
new file mode 100644
index 0000000..235b2bf
--- /dev/null
+++ b/error.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+ UDlink Docs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Hi! Something went wrong, here's some more information:
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/error.js b/error.js
new file mode 100644
index 0000000..209b2ba
--- /dev/null
+++ b/error.js
@@ -0,0 +1,33 @@
+const info = document.getElementById("error-info");
+const urlParams = new URLSearchParams(window.location.search);
+const error = urlParams.get("e") || undefined;
+
+if (error === undefined) {
+ window.location.replace("https://docs.udl.ink/");
+} else {
+ if (error == "tokenid") {
+ const domain = urlParams.get("domain");
+ info.innerHTML =
+ `The Unstoppable Domains API did not return a token ID
+ for that domain: ${domain}. You might want to search for the domain
+ directly on Etherscan / Opensea / Polygonscan.`;
+ } else if (error == "gateway") {
+ const gateway = urlParams.get("gateway");
+ info.innerHTML =
+ `Invalid IPFS Gateway selected for redirect: ${gateway}
+ Check available gateways on the homepage.`;
+ } else if (error == "tld") {
+ const domain = urlParams.get("domain");
+ info.innerHTML =
+ `Invalid Unstoppable Domains TLD, requested domain: ${domain}
+ Check the domain and try again.`;
+ } else if (error == "nohash") {
+ const domain = urlParams.get("domain");
+ info.innerHTML =
+ `No linked IPFS hash for the requested domain: ${domain}
+ Check the domain or the Unstoppabe Dashboard and try again.`;
+ } else {
+ info.innerHTML =
+ `Sorry, we're not sure what happened, please try again.`;
+ }
+}