-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: node transports #1414
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
feat: node transports #1414
Conversation
01be670
to
bafef7c
Compare
packages/browser/src/backend.ts
Outdated
import { supportsFetch } from '@sentry/utils/supports'; | ||
import { Raven } from './raven'; | ||
import { FetchTransport, XHRTransport } from './transports'; | ||
|
||
/** | ||
* Configuration options for the Sentry Browser SDK. | ||
* @see BrowserClient for more information. | ||
* @see BrowserClient afor more information. |
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.
afor
packages/browser/src/index.ts
Outdated
@@ -27,3 +29,6 @@ export { init } from './sdk'; | |||
|
|||
import * as Integrations from './integrations'; | |||
export { Integrations }; | |||
|
|||
import * as Transports from './transports'; | |||
export { Transports }; |
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 can make it export { Integrations, Transports };
in one call.
@@ -25,6 +25,12 @@ export class FetchTransport extends BaseTransport { | |||
: '') as ReferrerPolicy, | |||
}; | |||
|
|||
return (global as Window).fetch(this.url, defaultOptions); | |||
const response = await (global as Window).fetch(this.url, defaultOptions); |
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.
It'll break if fetch
throws. We should put it in try/catch
clause I guess
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.
Or will async
wrap it in reject
call? 🤔
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.
async
handles everything 💪
Codecov Report
@@ Coverage Diff @@
## master #1414 +/- ##
=========================================
Coverage ? 87.15%
=========================================
Files ? 35
Lines ? 825
Branches ? 133
=========================================
Hits ? 719
Misses ? 97
Partials ? 9
Continue to review full report at Codecov.
|
NOTE: Investigate "endless loop with |
No description provided.