Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.4.2
Choose a base ref
...
head repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.5.0
Choose a head ref
  • 13 commits
  • 90 files changed
  • 5 contributors

Commits on Dec 13, 2018

  1. Copy the full SHA
    1fb4808 View commit details

Commits on Jan 9, 2019

  1. fix: Rewrite transport and queue to improve memory consumption (#1795)

    * fix: Limit concurrent FS calls to prevent memory fragmentation
    
    * fix: Move limiter to node, Add frameContextLines option
    
    * Update .gitignore
    
    * feat: Pass string into transport, Use request buffer directly in transport
    
    * feat: Use buffer in transport
    
    * feat: Add all changes for transport and buffers
    
    * fix: Linter
    
    * fix: Wording
    
    * fix: Don't break the API
    
    * feat: Add simple lru cache for readFiles
    
    * meta: Code Review
    
    * meta: Linter errros
    
    * fix: Changelog + docs
    
    * fix: Browser integration tests
    
    * fix: Also cache if the file wasn't readable
    
    * fix: Linter
    kamilogorek authored and HazAT committed Jan 9, 2019
    Copy the full SHA
    1d64ace View commit details
  2. fix: Permission denied to access property name (#1812)

    Sometimes a "Permission denied" Error is thrown when trying to
    access the "name" property of a wrapped function.
    josketres authored and kamilogorek committed Jan 9, 2019
    Copy the full SHA
    73b8d65 View commit details
  3. fix: Add type/value to exception in case of no error (#1803)

    * fix: Add type/value to exception in case of no error
    
    * fix: Init first element in array
    
    * fix: Test and stacktrace
    
    * fix: Unhandled promise rejections
    HazAT authored Jan 9, 2019
    Copy the full SHA
    44ce010 View commit details
  4. fix: Check if value is error object in extraErrorData integration (#1817

    )
    
    * check if value is error object, also use getOwnPropertyNames
    * use isError method
    github-felipe-caputo authored and kamilogorek committed Jan 9, 2019
    Copy the full SHA
    3c45c2f View commit details
  5. Copy the full SHA
    b12a241 View commit details

Commits on Jan 10, 2019

  1. fix: Node 10 tests (#1827)

    * fix: Node 10 tests
    
    * feat: Update linter, update tests
    
    * fix: typescript version
    
    * fix: Tests
    
    * fix: Tests
    
    * fix: node 6 build
    
    * fix: Add conditional for PRs
    
    * fix: Travis
    HazAT authored Jan 10, 2019
    Copy the full SHA
    3146f94 View commit details
  2. fix: Normalize data before passing it to transport (#1826)

    * fix: Handle circular dependencies in serialize method
    
    * Use truncate instead
    kamilogorek authored and HazAT committed Jan 10, 2019
    Copy the full SHA
    aff8415 View commit details
  3. feat: esm build (#1779)

    * Added esm build and fixed some minor issues
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Fixed some ones prettier mismatch
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Utils es5 only
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * esm for utils and import rewrites
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * improved and documented rewrite regex
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Removed arrow function to support node 6
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Trying to fix node 6 problem
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Added readme entry
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Mark as free of side-effects
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Fixed wrong bool value for side-effects
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Reordered .gitignore
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Removed as default for module builds
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Readded raven.js
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    
    * Added esm to browser .gitignore
    
    Signed-off-by: cromefire <tim.langhorst@outlook.de>
    cromefire authored and HazAT committed Jan 10, 2019
    Copy the full SHA
    b73d9e9 View commit details
  4. Copy the full SHA
    ad05df8 View commit details
  5. meta: Prepare 4.5.0

    HazAT committed Jan 10, 2019
    Copy the full SHA
    149e8f0 View commit details
  6. fix: Exclude esm from docs

    HazAT committed Jan 10, 2019
    Copy the full SHA
    c3c2f6e View commit details
  7. release: 4.5.0

    HazAT committed Jan 10, 2019
    Copy the full SHA
    2362a57 View commit details
Showing with 1,221 additions and 511 deletions.
  1. +4 −0 .gitignore
  2. +2 −1 .travis.yml
  3. +1 −1 .vscode/extensions.json
  4. +20 −3 CHANGELOG.md
  5. +11 −0 README.md
  6. +1 −1 lerna.json
  7. +5 −3 package.json
  8. +1 −0 packages/browser/.npmignore
  9. +14 −9 packages/browser/package.json
  10. +26 −32 packages/browser/src/backend.ts
  11. +17 −4 packages/browser/src/integrations/trycatch.ts
  12. +13 −0 packages/browser/src/parsers.ts
  13. +14 −4 packages/browser/src/transports/base.ts
  14. +8 −9 packages/browser/src/transports/beacon.ts
  15. +8 −9 packages/browser/src/transports/fetch.ts
  16. +20 −19 packages/browser/src/transports/xhr.ts
  17. +1 −1 packages/browser/src/version.ts
  18. +3 −11 packages/browser/test/backend.test.ts
  19. +4 −24 packages/browser/test/index.test.ts
  20. +2 −2 packages/browser/test/integration/init.js
  21. +19 −0 packages/browser/test/integration/test.js
  22. +12 −0 packages/browser/test/mocks/simpletransport.ts
  23. +3 −3 packages/browser/test/transports/base.test.ts
  24. +3 −3 packages/browser/test/transports/beacon.test.ts
  25. +3 −3 packages/browser/test/transports/fetch.test.ts
  26. +3 −3 packages/browser/test/transports/xhr.test.ts
  27. +8 −0 packages/browser/tsconfig.esm.json
  28. +1 −2 packages/browser/tsconfig.json
  29. +1 −0 packages/core/.npmignore
  30. +16 −11 packages/core/package.json
  31. +23 −10 packages/core/src/basebackend.ts
  32. +34 −25 packages/core/src/baseclient.ts
  33. +2 −1 packages/core/src/index.ts
  34. +1 −1 packages/core/src/integration.ts
  35. +9 −7 packages/core/src/integrations/extraerrordata.ts
  36. +6 −5 packages/core/src/interfaces.ts
  37. +23 −2 packages/core/src/{requestbuffer.ts → promisebuffer.ts}
  38. +21 −0 packages/core/src/transports/noop.ts
  39. +17 −0 packages/core/test/lib/base.test.ts
  40. +33 −3 packages/core/test/lib/integrations/extraerrordata.test.ts
  41. +31 −12 packages/core/test/lib/{requestbuffer.test.ts → promisebuffer.test.ts}
  42. +8 −0 packages/core/tsconfig.esm.json
  43. +1 −2 packages/core/tsconfig.json
  44. +1 −0 packages/hub/.npmignore
  45. +13 −8 packages/hub/package.json
  46. +8 −0 packages/hub/tsconfig.esm.json
  47. +1 −2 packages/hub/tsconfig.json
  48. +1 −0 packages/minimal/.npmignore
  49. +13 −8 packages/minimal/package.json
  50. +8 −0 packages/minimal/tsconfig.esm.json
  51. +1 −2 packages/minimal/tsconfig.json
  52. +12 −10 packages/node/package.json
  53. +36 −36 packages/node/src/backend.ts
  54. +1 −0 packages/node/src/declarations.d.ts
  55. +69 −25 packages/node/src/parsers.ts
  56. +40 −30 packages/node/src/transports/base.ts
  57. +4 −4 packages/node/src/transports/http.ts
  58. +4 −5 packages/node/src/transports/https.ts
  59. +1 −1 packages/node/src/version.ts
  60. +3 −0 packages/node/test/helper/error.ts
  61. +11 −9 packages/node/test/helper/settimeouttransport.ts
  62. +38 −7 packages/node/test/index.test.ts
  63. +1 −1 packages/node/test/manual/express-scope-separation/start.js
  64. +45 −0 packages/node/test/parsers.test.ts
  65. +25 −15 packages/node/test/transports/http.test.ts
  66. +30 −18 packages/node/test/transports/https.test.ts
  67. +1 −2 packages/node/tsconfig.json
  68. +2 −2 packages/raven-node/lib/utils.js
  69. +1 −0 packages/types/.npmignore
  70. +11 −6 packages/types/package.json
  71. +18 −2 packages/types/src/index.ts
  72. +8 −0 packages/types/tsconfig.esm.json
  73. +1 −2 packages/types/tsconfig.json
  74. +2 −2 packages/typescript/package.json
  75. +12 −1 packages/typescript/tsconfig.json
  76. +12 −7 packages/utils/package.json
  77. +5 −6 packages/utils/src/fs.ts
  78. +11 −0 packages/utils/src/is.ts
  79. +27 −44 packages/utils/src/object.ts
  80. +2 −3 packages/utils/src/string.ts
  81. +16 −1 packages/utils/test/is.test.ts
  82. +146 −1 packages/utils/test/object.test.ts
  83. +1 −1 packages/utils/test/string.test.ts
  84. +10 −0 packages/utils/tsconfig.esm.json
  85. +1 −2 packages/utils/tsconfig.json
  86. +44 −0 scripts/esm-rewrite.js
  87. +6 −1 scripts/test.sh
  88. +7 −0 tsconfig.esm.json
  89. +1 −0 typedoc.js
  90. +57 −21 yarn.lock
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ node_modules/
# build and test
build/
packages/*/dist/
/packages/*/esm
coverage/
scratch/
*.pyc
@@ -27,3 +28,6 @@ lerna-debug.log

docs
lint-results.json

# legacy
!/packages/raven-js/dist
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ cache:
directories:
- node_modules

matrix:
jobs:
include:
- name: '@sentry/packages - build + lint + test + codecov + danger [node v8]'
node_js: '8'
@@ -38,6 +38,7 @@ matrix:
firefox: latest
script: scripts/browser-integration.sh
- name: '@sentry/browser - saucelabs tests'
if: fork = false
node_js: '8'
addons:
sauce_connect: true
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["esbenp.prettier-vscode", "eg2.tslint", "stkb.rewrap"]
"recommendations": ["esbenp.prettier-vscode", "ms-vscode.vscode-typescript-tslint-plugin"]
}
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,23 @@

## Unreleased

## 4.5.0

- [core] feat: Deprecate `captureEvent`, prefer `sendEvent` for transports. `sendEvent` now takes a string (body)
instead of `Event` object.
- [core] feat: Use correct buffer for requests in transports
- [core] feat: (beta) provide esm build
- [core] ref: Change way how transports are initialized
- [core] ref: Rename `RequestBuffer` to `PromiseBuffer`, also introduce limit
- [core] ref: Make sure that captureMessage input is a primitive
- [core] fix: Check if value is error object in extraErrorData integration
- [browser] fix: Prevent empty exception values
- [browser] fix: Permission denied to access property name
- [node] feat: Add file cache for providing pre/post context in frames
- [node] feat: New option `frameContextLines`, if set to `0` we do not provide source code pre/post context, default is
`7` lines pre/post
- [utils] fix: Use custom serializer inside `serialize` method to prevent circular references

## 4.4.2

- [node] Port memory-leak tests from raven-node
@@ -68,9 +85,9 @@

## 4.2.1

- [core]: Invert logger logic the explicitly enable it.
- [hub]: Require `domain` in `getCurrentHub` in try/catch - Fixed #1670
- [hub]: Removed exposed getter on the Scope.
- [core] Invert logger logic the explicitly enable it.
- [hub] Require `domain` in `getCurrentHub` in try/catch - Fixed #1670
- [hub] Removed exposed getter on the Scope.

## 4.2.0

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -72,6 +72,17 @@ init({
captureMessage('Hello, world!');
```

If you want sentry to be customized for the browsers you want to support use the `esm` build:
```javascript
import { init, captureMessage } from '@sentry/browser/esm';
```

and add it to your babel/... build, if you want to support older browsers

> TIP: You can use [`<script type="module" str="newbrowser.js">` +
`<script nomodule src="oldbrowser.js">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Module_Fallback)
to provide builds for newer and older browsers

## Other Packages

Besides the high-level SDKs, this repository contains shared packages, helpers and configuration used for SDK
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.0",
"version": "4.4.2",
"version": "4.5.0",
"packages": "packages/*",
"ignore": "raven-*",
"npmClient": "yarn",
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
"private": true,
"scripts": {
"build": "lerna run --stream --concurrency 1 --sort build",
"build:es5": "lerna run --stream --concurrency 1 --sort build:es5",
"build:esm": "lerna run --stream --concurrency 1 --sort build:esm",
"build:watch": "lerna run build:watch --stream --no-sort --concurrency 9999",
"clean": "lerna run --stream clean",
"fix": "lerna run --stream --concurrency 1 fix",
@@ -39,14 +41,14 @@
"npm-run-all": "^4.1.2",
"prettier": "^1.14.0",
"prettier-check": "^2.0.0",
"replace-in-file": "^3.4.0",
"replace-in-file": "^3.4.2",
"rimraf": "^2.6.2",
"sinon": "^7.1.1",
"ts-jest": "^23.10.5",
"tslint": "^5.11.0",
"tslint-language-service": "^0.9.9",
"typedoc": "^0.13.0",
"typedoc-plugin-monorepo": "^0.1.0",
"typescript": "^3.0.1"
"typescript": "^3.2.0",
"typescript-tslint-plugin": "^0.2.1"
}
}
1 change: 1 addition & 0 deletions packages/browser/.npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*
!/dist/**/*
!/build/**/*
!/esm/**/*
23 changes: 14 additions & 9 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@sentry/browser",
"version": "4.4.2",
"version": "4.5.0",
"description": "Offical Sentry SDK for browsers",
"repository": "git://github.com/getsentry/raven-js.git",
"homepage": "https://github.com/getsentry/raven-js/tree/master/packages/browser",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
"author": "Sentry",
"license": "BSD-3-Clause",
"engines": {
@@ -15,9 +15,9 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "4.4.2",
"@sentry/types": "4.4.2",
"@sentry/utils": "4.4.2",
"@sentry/core": "4.5.0",
"@sentry/types": "4.5.0",
"@sentry/utils": "4.5.0",
"tslib": "^1.9.3"
},
"devDependencies": {
@@ -48,11 +48,15 @@
"rollup-plugin-uglify": "^3.0.0",
"sinon": "^5.0.3",
"tslint": "^5.11.0",
"typescript": "^3.0.1",
"typescript": "^3.2.0",
"webpack": "^4.26.0"
},
"scripts": {
"build": "rollup --config",
"build": "run-p build:esm build:es5",
"build:es5": "rollup --config",
"build:esm": "run-s build:esm:transpile build:esm:rewrite",
"build:esm:transpile": "tsc -p tsconfig.esm.json",
"build:esm:rewrite": "node ../../scripts/esm-rewrite.js",
"build:watch": "rollup --config --watch",
"clean": "rimraf dist coverage .rpt2_cache build",
"lint": "run-s lint:prettier lint:tslint",
@@ -71,5 +75,6 @@
"size:check": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print $1,\"kB\";}'",
"version": "node ../../scripts/versionbump.js src/version.ts"
},
"gitHead": "a91da22f8bd3bddb38fab7f868326e376da82d4d"
"gitHead": "a91da22f8bd3bddb38fab7f868326e376da82d4d",
"sideEffects": false
}
58 changes: 26 additions & 32 deletions packages/browser/src/backend.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { BaseBackend, Options, SentryError } from '@sentry/core';
import { SentryEvent, SentryEventHint, SentryResponse, Severity, Status } from '@sentry/types';
import { SentryEvent, SentryEventHint, Severity, Transport } from '@sentry/types';
import { isDOMError, isDOMException, isError, isErrorEvent, isPlainObject } from '@sentry/utils/is';
import { logger } from '@sentry/utils/logger';
import { supportsBeacon, supportsFetch } from '@sentry/utils/supports';
import { eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';
import { addExceptionTypeValue, eventFromPlainObject, eventFromStacktrace, prepareFramesForEvent } from './parsers';
import { computeStackTrace } from './tracekit';
import { BeaconTransport, FetchTransport, XHRTransport } from './transports';

@@ -46,6 +45,27 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
return true;
}

/**
* @inheritdoc
*/
protected setupTransport(): Transport {
if (!this.options.dsn) {
// We return the noop transport here in case there is no Dsn.
return super.setupTransport();
}

const transportOptions = this.options.transportOptions ? this.options.transportOptions : { dsn: this.options.dsn };

if (this.options.transport) {
return new this.options.transport(transportOptions);
} else if (supportsBeacon()) {
return new BeaconTransport(transportOptions);
} else if (supportsFetch()) {
return new FetchTransport(transportOptions);
}
return new XHRTransport(transportOptions);
}

/**
* @inheritDoc
*/
@@ -67,6 +87,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
const message = ex.message ? `${name}: ${ex.message}` : name;

event = await this.eventFromMessage(message, undefined, hint);
addExceptionTypeValue(event, message);
} else if (isError(exception as Error)) {
// we have a real Error object, do nothing
event = eventFromStacktrace(computeStackTrace(exception as Error));
@@ -76,6 +97,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
// which is much better than creating new group when any key/value change
const ex = exception as {};
event = eventFromPlainObject(ex, hint.syntheticException);
addExceptionTypeValue(event, 'Custom Object');
} else {
// If none of previous checks were valid, then it means that
// it's not a DOMError/DOMException
@@ -85,6 +107,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
// So bail out and capture it as a simple message:
const ex = exception as string;
event = await this.eventFromMessage(ex, undefined, hint);
addExceptionTypeValue(event, `${ex}`);
}

event = {
@@ -126,33 +149,4 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {

return event;
}

/**
* @inheritDoc
*/
public async sendEvent(event: SentryEvent): Promise<SentryResponse> {
if (!this.options.dsn) {
logger.warn(`Event has been skipped because no Dsn is configured.`);
// We do nothing in case there is no DSN
return { status: Status.Skipped, reason: `Event has been skipped because no Dsn is configured.` };
}

if (!this.transport) {
const transportOptions = this.options.transportOptions
? this.options.transportOptions
: { dsn: this.options.dsn };

if (this.options.transport) {
this.transport = new this.options.transport({ dsn: this.options.dsn });
} else if (supportsBeacon()) {
this.transport = new BeaconTransport(transportOptions);
} else if (supportsFetch()) {
this.transport = new FetchTransport(transportOptions);
} else {
this.transport = new XHRTransport(transportOptions);
}
}

return this.transport.captureEvent(event);
}
}
21 changes: 17 additions & 4 deletions packages/browser/src/integrations/trycatch.ts
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export class TryCatch implements Integration {
const originalCallback = args[0];
args[0] = wrap(originalCallback, {
mechanism: {
data: { function: original.name || '<anonymous>' },
data: { function: getFunctionName(original) },
handled: true,
type: 'instrument',
},
@@ -41,7 +41,7 @@ export class TryCatch implements Integration {
mechanism: {
data: {
function: 'requestAnimationFrame',
handler: (original && original.name) || '<anonymous>',
handler: getFunctionName(original),
},
handled: true,
type: 'instrument',
@@ -74,7 +74,7 @@ export class TryCatch implements Integration {
mechanism: {
data: {
function: 'handleEvent',
handler: (fn && ((fn as any) as SentryWrappedFunction).name) || '<anonymous>',
handler: getFunctionName(fn),
target,
},
handled: true,
@@ -129,7 +129,7 @@ export class TryCatch implements Integration {
mechanism: {
data: {
function: 'addEventListener',
handler: (fn && ((fn as any) as SentryWrappedFunction).name) || '<anonymous>',
handler: getFunctionName(fn),
target,
},
handled: true,
@@ -209,3 +209,16 @@ export class TryCatch implements Integration {
].forEach(this.wrapEventTarget.bind(this));
}
}

/**
* Safely extract function name from itself
*/
function getFunctionName(fn: any): string {
try {
return (fn && fn.name) || '<anonymous>';
} catch (e) {
// Just accessing custom props in some Selenium environments
// can cause a "Permission denied" exception (see raven-js#495).
return '<anonymous>';
}
}
13 changes: 13 additions & 0 deletions packages/browser/src/parsers.ts
Original file line number Diff line number Diff line change
@@ -92,3 +92,16 @@ export function prepareFramesForEvent(stack: TraceKitStackFrame[]): StackFrame[]
.slice(0, STACKTRACE_LIMIT)
.reverse();
}

/**
* Adds exception values, type and value to an synthetic Exception.
* @param event The event to modify.
* @param message Message to be added.
*/
export function addExceptionTypeValue(event: SentryEvent, message: string): void {
event.exception = event.exception || {};
event.exception.values = event.exception.values || [];
event.exception.values[0] = event.exception.values[0] || {};
event.exception.values[0].value = event.exception.values[0].value || message;
event.exception.values[0].type = event.exception.values[0].type || 'Error';
}
18 changes: 14 additions & 4 deletions packages/browser/src/transports/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { API, SentryError } from '@sentry/core';
import { SentryEvent, SentryResponse, Transport, TransportOptions } from '@sentry/types';
import { API, PromiseBuffer, SentryError } from '@sentry/core';
import { SentryResponse, Transport, TransportOptions } from '@sentry/types';

/** Base Transport class implementation */
export abstract class BaseTransport implements Transport {
@@ -8,14 +8,24 @@ export abstract class BaseTransport implements Transport {
*/
public url: string;

/** A simple buffer holding all requests. */
protected readonly buffer: PromiseBuffer<SentryResponse> = new PromiseBuffer(30);

public constructor(public options: TransportOptions) {
this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth();
}

/**
* @inheritDoc
*/
public async captureEvent(_: SentryEvent): Promise<SentryResponse> {
throw new SentryError('Transport Class has to implement `captureEvent` method');
public async sendEvent(_: string): Promise<SentryResponse> {
throw new SentryError('Transport Class has to implement `sendEvent` method');
}

/**
* @inheritDoc
*/
public async close(timeout?: number): Promise<boolean> {
return this.buffer.drain(timeout);
}
}
Loading