@@ -6,6 +6,8 @@ Test playground for Hawk Error Tracker integration with SvelteKit and Svelte.
66
77- [ Getting Started] ( #getting-started )
88- [ Hawk Integration] ( #hawk-integration )
9+ - [ Error Handling] ( #error-handling )
10+ - [ Error Test Pages] ( #error-test-pages )
911
1012## Getting Started
1113
@@ -28,10 +30,10 @@ yarn dev
2830Current integration in ` hooks.client.ts ` :
2931
3032``` typescript
31- import Hawk from ' @hawk.so/javascript' ;
33+ import HawkCatcher from ' @hawk.so/javascript' ;
3234
3335if (import .meta .env .VITE_HAWK_TOKEN ) {
34- new Hawk ({
36+ new HawkCatcher ({
3537 token: import .meta .env .VITE_HAWK_TOKEN
3638 });
3739}
@@ -41,3 +43,31 @@ Hawk automatically registers global error handlers for:
4143
4244- ` window.onerror `
4345- ` window.onunhandledrejection `
46+
47+ ** Note:** HawkCatcher is browser-only and cannot run on the server (uses ` localStorage ` , ` window ` , etc.). Server-side
48+ errors are not tracked automatically.
49+
50+ ## Error Handling
51+
52+ ### Global Error Handlers (🔴)
53+
54+ Global browser error handlers that catch unhandled errors:
55+
56+ - ** ` window.error ` **
57+ - ** ` window.unhandledrejection ` **
58+
59+ ** Note:** global errors will be caught using Hawk Catcher.
60+
61+ ## Error Test Pages
62+
63+ The playground includes test pages to demonstrate each error catching mechanism:
64+
65+ ### Global Error Handlers (🔴)
66+
67+ 1 . ** Runtime Error** (` /errors/runtime-error ` )
68+ - Demonstrates synchronous error in event handler
69+ - Caught by ` window.error `
70+
71+ 2 . ** Promise Rejection** (` /errors/promise-rejection ` )
72+ - Demonstrates unhandled Promise rejection
73+ - Caught by ` window.unhandledrejection `
0 commit comments