Improve catching of errors when loading routes

- Handle ResponseParseErros, ResponseErrors and normal errors
  differently.
- Show them all in the same `LoadError` view
- Add a subtitle to give users some more information on what could have
  gone wrong.
- Add more properties to the copyable error message to make debugging
  easier.
This commit is contained in:
Sebastian Martinez
2024-02-15 13:26:11 -03:00
parent 8450f0cd9c
commit d216caec7d
24 changed files with 389 additions and 185 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
import type { Comment } from "@httpd-client";
import type { BaseUrl, Comment } from "@httpd-client";
import md5 from "md5";
import bs58 from "bs58";
@@ -93,6 +93,10 @@ export function formatEditedCaption(lastEdit: Comment["edits"][0]) {
} edited ${formatTimestamp(lastEdit.timestamp / 1000)}`;
}
export function baseUrlToUrl(baseUrl: BaseUrl): URL {
return new URL(`${baseUrl.scheme}://${baseUrl.hostname}:${baseUrl.port}`);
}
// Generates a publicly shareable link.
export function formatPublicExplorer(
publicExplorer: string,