FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Exceptionless.JavaScript/example/nextjs/app/error.jsx at main · exceptionless/Exceptionless.JavaScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
exceptionless
/
Exceptionless.JavaScript
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
22
Star
60
Code
Issues
0
Pull requests
11
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Exceptionless.JavaScript
/
example
/
nextjs
/
app
/
error.jsx
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (39 loc) · 1.41 KB
Breadcrumbs
Exceptionless.JavaScript
/
example
/
nextjs
/
app
/
error.jsx
Copy path
File metadata and controls
43 lines (39 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"use client"
;
import
Link
from
"next/link"
;
import
{
useEffect
}
from
"react"
;
import
{
Exceptionless
,
startup
}
from
"../lib/exceptionless-browser.js"
;
export
default
function
ErrorPage
(
{
error
,
reset
}
)
{
useEffect
(
(
)
=>
{
if
(
!
error
.
digest
)
{
void
(
async
(
)
=>
{
try
{
await
startup
(
)
;
await
Exceptionless
.
createException
(
error
)
.
addTags
(
"error-boundary"
)
.
setProperty
(
"handledBy"
,
"app/error.jsx"
)
.
submit
(
)
;
}
catch
(
submitError
)
{
console
.
error
(
"Exceptionless route boundary capture failed"
,
submitError
)
;
}
}
)
(
)
;
}
}
,
[
error
]
)
;
return
(
<
main
className
=
"error-shell"
>
<
section
className
=
"panel error-card"
>
<
div
className
=
"panel-body"
>
<
p
className
=
"eyebrow"
>
Route Error Boundary
</
p
>
<
h1
>
Something inside this route broke.
</
h1
>
<
p
>
Client-only render errors are submitted here. Server-rendered failures already have a digest and are captured by `instrumentation.js` through
`onRequestError`.
</
p
>
<
div
className
=
"error-actions"
>
<
button
type
=
"button"
onClick
=
{
(
)
=>
reset
(
)
}
>
Retry this route
</
button
>
<
Link
href
=
"/"
>
Back to the example
</
Link
>
</
div
>
{
error
.
digest
?
<
p
className
=
"error-digest"
>
Server digest:
{
error
.
digest
}
</
p
>
:
null
}
</
div
>
</
section
>
</
main
>
)
;
}
Back
|
FazBrowse Home
|
New Git URL