@appsignal/types
Advanced tools
Comparing version 2.1.5 to 2.1.6
# AppSignal types changelog | ||
## 2.1.6 | ||
- [e737a7f](https://github.com/appsignal/appsignal-javascript/commit/e737a7f8ca15cbe3577a7209e641b43610f0f68b) patch - Add callback argument to the `sendError` function to allow for more customization of errors sent with `sendError` and `wrap`. The `tags` and `namespace` parameters are now deprecated for both helpers. | ||
```js | ||
// Deprecated behavior | ||
appsignal.sendError( | ||
new Error("sendError with tags and namespace argument"), | ||
{ tag1: "value 1", tag2: "value 2" }, | ||
"custom_namespace" | ||
); | ||
// New behavior | ||
appsignal.sendError( | ||
new Error("sendError with callback argument"), | ||
function(span) { | ||
span.setAction("SendErrorTestAction"); | ||
span.setNamespace("custom_namespace"); | ||
span.setTags({ tag1: "value 1", tag2: "value 2" }); | ||
} | ||
); | ||
``` | ||
## 2.1.5 | ||
@@ -4,0 +27,0 @@ |
@@ -28,8 +28,12 @@ import { Tracer } from "./tracer"; | ||
ignored: RegExp[]; | ||
send<T>(error: Error, fn?: (span: JSSpan) => T): Promise<JSSpan> | void; | ||
send(error: Error, tags?: object, namespace?: string): Promise<JSSpan> | void; | ||
send(span: JSSpan): Promise<JSSpan> | void; | ||
send(data: Error | JSSpan, tags?: object, namespace?: string): Promise<any> | void; | ||
sendError<T>(error: Error): Promise<JSSpan> | void; | ||
sendError<T>(error: Error, fn?: (span: JSSpan) => T): Promise<JSSpan> | void; | ||
sendError(error: Error, tags?: object, namespace?: string): Promise<JSSpan> | void; | ||
use(plugin: Function): void; | ||
createSpan(fn?: (span: JSSpan) => void): JSSpan; | ||
wrap<T>(fn: () => T, callbackFn?: (span: JSSpan) => T): Promise<T>; | ||
wrap<T>(fn: () => T, tags?: {}, namespace?: string): Promise<T>; | ||
@@ -36,0 +40,0 @@ addDecorator<T extends Hook>(decorator: T): void; |
@@ -28,8 +28,12 @@ import { Tracer } from "./tracer"; | ||
ignored: RegExp[]; | ||
send<T>(error: Error, fn?: (span: JSSpan) => T): Promise<JSSpan> | void; | ||
send(error: Error, tags?: object, namespace?: string): Promise<JSSpan> | void; | ||
send(span: JSSpan): Promise<JSSpan> | void; | ||
send(data: Error | JSSpan, tags?: object, namespace?: string): Promise<any> | void; | ||
sendError<T>(error: Error): Promise<JSSpan> | void; | ||
sendError<T>(error: Error, fn?: (span: JSSpan) => T): Promise<JSSpan> | void; | ||
sendError(error: Error, tags?: object, namespace?: string): Promise<JSSpan> | void; | ||
use(plugin: Function): void; | ||
createSpan(fn?: (span: JSSpan) => void): JSSpan; | ||
wrap<T>(fn: () => T, callbackFn?: (span: JSSpan) => T): Promise<T>; | ||
wrap<T>(fn: () => T, tags?: {}, namespace?: string): Promise<T>; | ||
@@ -36,0 +40,0 @@ addDecorator<T extends Hook>(decorator: T): void; |
{ | ||
"name": "@appsignal/types", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"main": "dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/esm/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36020
347