-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: react suspense log added #565
Changes from 5 commits
9a1ffbe
0d50607
37f3f90
c8f66bd
66db774
2f2e14d
5eef8e0
1a583e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ module ErrorTextAndImage = { | |
|
||
module ErrorCard = { | ||
@react.component | ||
let make = (~error: Sentry.ErrorBoundary.fallbackArg, ~level) => { | ||
let make = (~error: Sentry.ErrorBoundary.fallbackArg, ~level, ~componentName) => { | ||
let beaconApiCall = data => { | ||
if data->Array.length > 0 { | ||
let logData = data->Array.map(OrcaLogger.logFileToObj)->JSON.Encode.array->JSON.stringify | ||
|
@@ -157,6 +157,7 @@ module ErrorCard = { | |
firstEvent: false, | ||
metadata: JSON.Encode.null, | ||
ephemeralKey: "", | ||
componentName, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Sanskar2001 will we be able to see this new type directly in Grafana or some other changes will be required? The use of this type is to help detect the component which crashed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @PritishBudhiraja We don't want to introduce one more column in sdk_events for this, can you please append the component name in value only? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated please check once |
||
} | ||
beaconApiCall([errorLog]) | ||
} | ||
|
@@ -200,10 +201,12 @@ module ErrorCard = { | |
} | ||
} | ||
|
||
let defaultFallback = (e, level) => { | ||
<ErrorCard error=e level /> | ||
let defaultFallback = (e, level, componentName) => { | ||
<ErrorCard error=e level componentName /> | ||
} | ||
@react.component | ||
let make = (~children, ~renderFallback=defaultFallback, ~level=PaymentMethod) => { | ||
<Sentry.ErrorBoundary fallback={e => renderFallback(e, level)}> children </Sentry.ErrorBoundary> | ||
let make = (~children, ~renderFallback=defaultFallback, ~level=PaymentMethod, ~componentName) => { | ||
<Sentry.ErrorBoundary fallback={e => renderFallback(e, level, componentName)}> | ||
children | ||
</Sentry.ErrorBoundary> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@react.component | ||
let make = (~children, ~loaderComponent, ~componentName) => { | ||
Console.log2("-- componentName -- ", componentName) | ||
PritishBudhiraja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<ErrorBoundary level=ErrorBoundary.PaymentMethod componentName> | ||
<React.Suspense fallback={loaderComponent}> {children} </React.Suspense> | ||
</ErrorBoundary> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this ErrorBoundary?