Skip to content

Commit

Permalink
Make trace done callback return value void
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Belanger committed Jan 2, 2024
1 parent 0547232 commit 2b81d92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ tracer.trace('test', { service: 'foo', resource: 'bar', type: 'baz' }, () => {})
tracer.trace('test', { measured: true }, () => {})
tracer.trace('test', (span: Span) => {})
tracer.trace('test', (span: Span, fn: () => void) => {})
tracer.trace('test', (span: Span, fn: (err: Error) => string) => {})
tracer.trace('test', (span: Span, fn: (err: Error) => void) => {})

promise = tracer.trace('test', () => Promise.resolve())

Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export declare interface Tracer extends opentracing.Tracer {
* option is deprecated and has been removed in version 4.0.
*/
trace<T> (name: string, fn: (span: Span) => T): T;
trace<T> (name: string, fn: (span: Span, done: (error?: Error) => string) => T): T;
trace<T> (name: string, options: TraceOptions & SpanOptions, fn: (span?: Span, done?: (error?: Error) => string) => T): T;
trace<T> (name: string, fn: (span: Span, done: (error?: Error) => any) => T): T;
trace<T> (name: string, options: TraceOptions & SpanOptions, fn: (span?: Span, done?: (error?: Error) => any) => T): T;

/**
* Wrap a function to automatically create a span activated on its
Expand Down

0 comments on commit 2b81d92

Please sign in to comment.