adds error logging for recommend api
This commit is contained in:
@@ -3,6 +3,7 @@ import type { Trail } from '$lib/models/trail';
|
||||
import { pb } from '$lib/pocketbase';
|
||||
import { handleError } from '$lib/util/api_util';
|
||||
import { error, json, type RequestEvent } from '@sveltejs/kit';
|
||||
import { ClientResponseError } from 'pocketbase';
|
||||
|
||||
export async function GET(event: RequestEvent) {
|
||||
try {
|
||||
@@ -13,6 +14,12 @@ export async function GET(event: RequestEvent) {
|
||||
size: safeSearchParams.size?.toString() ?? ""
|
||||
})));
|
||||
|
||||
if (!r.ok) {
|
||||
const response = await r.json()
|
||||
console.error(response)
|
||||
throw new ClientResponseError({ status: response.code, response })
|
||||
}
|
||||
|
||||
const result: Trail[] = await r.json();
|
||||
|
||||
for (const t of result) {
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
{loading}>Login</Button
|
||||
>
|
||||
</div>
|
||||
{#if env.PUBLIC_DISABLE_SIGNUP === "false"}
|
||||
{#if env.PUBLIC_DISABLE_SIGNUP !== "true"}
|
||||
<span
|
||||
>{$_("no-account")}
|
||||
<a class="text-blue-500 underline" href="/register"
|
||||
|
||||
Reference in New Issue
Block a user