-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[NEXT] Frontend -> Client #1323
Conversation
packages/browser/src/backend.ts
Outdated
@@ -12,7 +12,9 @@ const sendRavenEvent = Raven._sendProcessedPayload.bind(Raven) as SendMethod; | |||
|
|||
/** Normalizes the event so it is consistent with our domain interface. */ | |||
function normalizeRavenEvent(event: SentryEvent): SentryEvent { | |||
const ex = (event.exception || {}) as { values?: SentryException[] }; | |||
const ex = ((event && event.exception) || {}) as { |
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.
There was an issue when running it with SDK loader thatevent
was null/undefined.
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.
That's not to be solved here.
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.
Can we fix this in captureEvent and change the top-level signature to SentryEvent | undefined
? This is way too deep and also defies type checking.
packages/browser/src/backend.ts
Outdated
public constructor(client: Client<BrowserOptions>) { | ||
this.client = client; | ||
} | ||
public constructor(private readonly options: BrowserOptions) {} |
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.
We probably also want the DSN here.
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.
I was thinking that we only pass in the options and if we need some fancy behavior our DSN
class supports, we create a DSN object in the backend.
See: https://github.com/getsentry/raven-js/pull/1323/files#diff-261a7b228c5d644e74c94c3f99ba8a9eR147
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.
WFM. We can assume that the DSN must be valid at that point, so there's also no need to catch exceptions anymore.
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.
LGTM!
No description provided.