Skip to content

Commit

Permalink
error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Nov 17, 2024
1 parent 16d0f1d commit 521f562
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 1 deletion.
54 changes: 54 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"maplibre-gl": "5.0.0-pre.5",
"moment": "^2.30.1",
"protobufjs": "^7.4.0",
"stringify-object": "^5.0.0",
"svelte-i18n": "^4.0.1",
"svelte-toasts": "^1.1.2",
"toastify-js": "^1.12.0",
Expand Down
18 changes: 17 additions & 1 deletion src/components/SingleTripInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import TimeDiff from './TimeDiff.svelte';
import polyline from '@mapbox/polyline';
import AlertBox from './serviceAlerts.svelte';
import stringifyObject from 'stringify-object';
import { writable, get } from 'svelte/store';
import {
fixHeadsignIcon,
Expand Down Expand Up @@ -428,6 +429,10 @@
console.log('refresh component');
} catch (e: any) {
error = text;
console.log(stringifyObject(trip_selected, {
indent: ' ',
singleQuotes: false
}))
}
})
.catch((e) => {
Expand Down Expand Up @@ -500,7 +505,18 @@

<div class="h-full">
{#if error != null}
{error}
<div>
<p>Error from server:</p>
<p class="font-mono">{error}</p>
<p>Request made:</p>
<p class="text-wrap text-xs font-mono">
{@html stringifyObject(trip_selected, {
indent: '\t',
singleQuotes: false
}).replaceAll("\n", "<br/>")}
</p>
<p>Report this error to the Catenary Discord server: <a href="https://discord.gg/w4Kd5Gj3re" target="_blank" class="underline text-blue-500 dark:text-blue-300">https://discord.gg/w4Kd5Gj3re</a></p>
</div>
{:else if is_loading_trip_data}
{#each [0, 1, 2, 3, 4, 5, 6, 7, 8] as it}
<div class="w-full p-3 flex flex-col gap-y-2">
Expand Down
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,11 @@ get-func-name@^2.0.1, get-func-name@^2.0.2:
resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz"
integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==

get-own-enumerable-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz"
integrity sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA==

get-source@^2.0.12:
version "2.0.12"
resolved "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz"
Expand Down Expand Up @@ -2040,6 +2045,11 @@ is-number@^7.0.0:
resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==

is-obj@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/is-obj/-/is-obj-3.0.0.tgz"
integrity sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==

is-path-inside@^3.0.3:
version "3.0.3"
resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz"
Expand Down Expand Up @@ -2069,6 +2079,11 @@ is-reference@1.2.1:
dependencies:
"@types/estree" "*"

is-regexp@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz"
integrity sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==

is-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz"
Expand Down Expand Up @@ -3435,6 +3450,15 @@ string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2"
strip-ansi "^7.0.1"

stringify-object@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/stringify-object/-/stringify-object-5.0.0.tgz"
integrity sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg==
dependencies:
get-own-enumerable-keys "^1.0.0"
is-obj "^3.0.0"
is-regexp "^3.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
Expand Down

0 comments on commit 521f562

Please sign in to comment.