diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts
index 9176095..d4759fd 100644
--- a/frontend/src/app.d.ts
+++ b/frontend/src/app.d.ts
@@ -1,8 +1,15 @@
// See https://kit.svelte.dev/docs/types#app
+
+import type { ErrorCode } from "$lib/api/entities";
+
// for information about these interfaces
declare global {
namespace App {
- // interface Error {}
+ interface Error {
+ code: ErrorCode;
+ message?: string | undefined;
+ details?: string | undefined;
+ }
// interface Locals {}
// interface PageData {}
// interface Platform {}
diff --git a/frontend/src/lib/components/ActiveLink.svelte b/frontend/src/lib/components/ActiveLink.svelte
new file mode 100644
index 0000000..d9bc887
--- /dev/null
+++ b/frontend/src/lib/components/ActiveLink.svelte
@@ -0,0 +1,10 @@
+
+
+
The page you were looking for was not found. If you're sure the page exists, check for any typos in the address.
-{:else if $page.status === 429} +{:else if $page.error?.code === ErrorCode.Forbidden || $page.error?.code === ErrorCode.InvalidToken} +You're not logged in, or you aren't allowed to access this page.
+{:else if $page.error?.code === 429}You've exceeded a rate limit, please try again later.
-{:else if $page.status === 500} +{:else if $page.error?.code === 500}An internal error occurred. Please try again later.
If this error keeps happening, please
{/if}
- Error message: Error code: The user you were looking for couldn't be found. Please check for any typos. You've exceeded a rate limit, please try again later. An internal error occurred. Please try again later.
- If this error keeps happening, please file a bug report with an explanation of what you did to cause the error.
+ Either you aren't logged in, or your login has expired. Please log in again.
You can only edit your own members. Error message: The user you were looking for couldn't be found. Please check for any typos. You've exceeded a rate limit, please try again later. An internal error occurred. Please try again later.
+ If this error keeps happening, please file a bug report with an explanation of what you did to cause the error.
+ Error message:
- Your profile is empty! You can customize it by going to the edit profile page. (only you can see this)
diff --git a/frontend/src/routes/@[username]/[memberName]/+page.server.ts b/frontend/src/routes/@[username]/[memberName]/+page.server.ts
index ab41c47..9b14e70 100644
--- a/frontend/src/routes/@[username]/[memberName]/+page.server.ts
+++ b/frontend/src/routes/@[username]/[memberName]/+page.server.ts
@@ -14,9 +14,9 @@ export const load = async ({ params }) => {
(e as APIError).code === ErrorCode.UserNotFound ||
(e as APIError).code === ErrorCode.MemberNotFound
) {
- throw error(404, (e as APIError).message);
+ throw error(404, e as APIError);
}
- throw error(500, (e as APIError).message);
+ throw error(500, e as APIError);
}
};
diff --git a/frontend/src/routes/@[username]/[memberName]/+page.svelte b/frontend/src/routes/@[username]/[memberName]/+page.svelte
index 504448a..9089959 100644
--- a/frontend/src/routes/@[username]/[memberName]/+page.svelte
+++ b/frontend/src/routes/@[username]/[memberName]/+page.svelte
@@ -65,7 +65,7 @@
This member's profile is empty! You can customize it by going to the edit memberedit member page. (only you can see this)
+ If you want to delete this member, type {deleteModalPronoun} name (
+
+
+
+ That member name is not valid.
+
+ Using {charCount($member.bio || "")}/{MAX_DESCRIPTION_LENGTH} characters
+
+ Why can't I see any flags?
+ There are thousands of pride flags, and it would be impossible to bundle all of them by
+ default. Many labels also have multiple different flags that are favoured by different
+ people. Because of this, there are no flags available by default--instead, you can upload
+ flags in your settings. Your main profile and your member
+ profiles can all have different flags.
+
+ {#if data.user.list_private}
+
+ Current short ID:
+
+
+
+ Using {charCount($user.bio || "")}/{MAX_DESCRIPTION_LENGTH} characters
+
+ Why can't I see any flags?
+ There are thousands of pride flags, and it would be impossible to bundle all of them by
+ default. Many labels also have multiple different flags that are favoured by different
+ people. Because of this, there are no flags available by default--instead, you can upload
+ flags in your settings. Your main profile and your member
+ profiles can all have different flags.
+
+
+ Current short ID:
+
+ You can optionally set your timezone, which will show your current local time on your
+ profile.
+
+ {#if $user.timezone}
+ This will show up on your profile like this:
+
+ Either you aren't logged in, or your login has expired. Please log in again.
+ You can only edit your own members. The user you were looking for couldn't be found. Please check for any typos. You've exceeded a rate limit, please try again later. An internal error occurred. Please try again later.
+ If this error keeps happening, please file a bug report with an explanation of what you did to cause the error.
+ Error message:
- If you want to delete this member, type {deleteModalPronoun} name (
-
-
-
- That member name is not valid.
-
- Using {charCount(bio)}/{MAX_DESCRIPTION_LENGTH} characters
-
- Why can't I see any flags?
- There are thousands of pride flags, and it would be impossible to bundle all of them
- by default. Many labels also have multiple different flags that are favoured by
- different people. Because of this, there are no flags available by default--instead,
- you can upload flags in your settings. Your main profile
- and your member profiles can all have different flags.
-
- {#if data.user.list_private}
-
- Current short ID:
-
-
-
- Using {charCount(bio)}/{MAX_DESCRIPTION_LENGTH} characters
-
- Why can't I see any flags?
- There are thousands of pride flags, and it would be impossible to bundle all of them
- by default. Many labels also have multiple different flags that are favoured by
- different people. Because of this, there are no flags available by default--instead,
- you can upload flags in your settings. Your main profile
- and your member profiles can all have different flags.
-
-
- Current short ID:
-
- You can optionally set your timezone, which will show your current local time on your
- profile.
-
- {#if timezone}
- This will show up on your profile like this:
-
{$page.error?.message}
{$page.error?.code}
An error occurred ({$page.status})
+Not logged in
Not your member
+ An error occurred ({$page.status})
-{$page.error?.message}
{$page.error?.message}
Edit your profile
+
Edit your profile
Edit profile
+
Edit profile
+ Edit profile
+
+
+{#if error}
+ {$member.name}
) below:
+ Names
+ {#each $member.names as _, index}
+
+
+ For example, you could use them for gender terms, honorifics, or compliments.
+
+
+ {/if}
+ pronouns.cc/@{$member.user.name}/{$member.name}
.
+
+ {$member.sid}
+
+
+ prns.cc
links. You can reroll one short ID every hour (shared
+ between your main profile and all members) by pressing the button above.
+
+
+ Edit profile
+
+
+{#if error}
+ Names
+ {#each $user.names as _, index}
+
+
+ For example, you could use them for gender terms, honorifics, or compliments.
+
+
+ {$user.sid}
+
+
+ prns.cc
links. You can reroll one short ID every hour (shared
+ between your main profile and all members) by pressing the button above.
+
+ pronouns.cc/@{$user.name}/[member-name]
.
+
+
+
+ {/if}
+
+ Your timezone is never shared directly, only the difference between UTC and your current
+ timezone is.
+
+
+ Preferences
+
+ {#each preferenceIds as id}
+ Not logged in
+ Not your member
+ An error occurred ({$page.status})
+
+ {#if $page.status === 404}
+ {$page.error?.message}
- Edit member profile
-
-
-{data.member.name}
) below:
- Names
- {#each names as _, index}
-
-
- For example, you could use them for gender terms, honorifics, or compliments.
-
-
- {/if}
- pronouns.cc/@{data.user.name}/{data.member.name}
.
-
- {data.member.sid}
-
-
- prns.cc
links. You can reroll one short ID every hour (shared
- between your main profile and all members) by pressing the button above.
-
-
- Edit profile
-
-
-{#if error}
- Names
- {#each names as _, index}
-
-
- For example, you could use them for gender terms, honorifics, or compliments.
-
-
- {data.user.sid}
-
-
- prns.cc
links. You can reroll one short ID every hour (shared
- between your main profile and all members) by pressing the button above.
-
- pronouns.cc/@{data.user.name}/[member-name]
.
-
-
-
- {/if}
-
- Your timezone is never shared directly, only the difference between UTC and your
- current timezone is.
-
-
- Preferences
-
- {#each preferenceIds as id}
-
- To change your avatar, go to edit profile.
+ To change your avatar, go to edit profile.