mirror of
https://github.com/supleed2/udlink-docs.git
synced 2024-09-19 21:36:18 +00:00
34 lines
1.3 KiB
JavaScript
34 lines
1.3 KiB
JavaScript
|
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<br>
|
||
|
for that domain: ${domain}. You might want to search for the domain<br>
|
||
|
directly on Etherscan / Opensea / Polygonscan.`;
|
||
|
} else if (error == "gateway") {
|
||
|
const gateway = urlParams.get("gateway");
|
||
|
info.innerHTML =
|
||
|
`Invalid IPFS Gateway selected for redirect: ${gateway}<br>
|
||
|
Check available gateways on <a href="https://docs.udl.ink/">the homepage</a>.`;
|
||
|
} else if (error == "tld") {
|
||
|
const domain = urlParams.get("domain");
|
||
|
info.innerHTML =
|
||
|
`Invalid Unstoppable Domains TLD, requested domain: ${domain}<br>
|
||
|
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}<br>
|
||
|
Check the domain or the Unstoppabe Dashboard and try again.`;
|
||
|
} else {
|
||
|
info.innerHTML =
|
||
|
`Sorry, we're not sure what happened, please try again.`;
|
||
|
}
|
||
|
}
|