refactored more error code

This commit is contained in:
2025-09-26 21:10:19 +02:00
parent e3b735bb7b
commit 2463f92b1c
23 changed files with 111 additions and 173 deletions

View File

@@ -3,9 +3,9 @@
import { useTinyRouter } from 'svelte-tiny-router';
import { api } from '../../urls.svelte.js';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte.js';
let error = $state(null);
let projects = $state({});
let router = useTinyRouter();
let tasks = $state(null);
@@ -27,7 +27,7 @@
if (resp.ok){
tasks[tid] = await resp.json();
} else {
error = await resp.text();
error(resp);
}
}
@@ -53,7 +53,7 @@
if (resp.ok){
projects[pid] = await resp.json();
} else {
error = await resp.text();
error(resp);
}
}
@@ -77,7 +77,7 @@
load();
}
} else {
error = await resp.text();
error(resp);
}
}
@@ -102,9 +102,6 @@
<fieldset>
<legend>{loading ? t('loading_object',{object:t('task_list')}) : t('task_list')}</legend>
{#if error}
<soan class="error">{error}</soan>
{/if}
{#if tasks}
<table>
<thead>