File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
public/node/vendor/otel-js/utils Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/cli-kit ' : patch
3+ ---
4+
5+ [ internal] suppress console errors when pushing metrics
Original file line number Diff line number Diff line change 55 DefaultOtelServiceOptions ,
66} from '../../public/node/vendor/otel-js/service/DefaultOtelService/DefaultOtelService.js'
77import { isUnitTest , opentelemetryDomain } from '../../public/node/context/local.js'
8- import { ValueType } from '@opentelemetry/api'
8+ import { ValueType , diag } from '@opentelemetry/api'
99
1010type MetricRecorder =
1111 | 'console'
@@ -150,6 +150,9 @@ function globalOtelService(options: CreateMetricRecorderOptions): OtelService {
150150 env : undefined ,
151151 otelEndpoint : `${ opentelemetryDomain ( ) } /v1/metrics` ,
152152 } )
153+ // Suppress OTEL diagnostic output — internal export errors (e.g. retryable failures)
154+ // should never appear in user-facing CLI output.
155+ diag . disable ( )
153156 }
154157 return _otelService
155158}
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ export function throttle<T extends (...args: any) => any>(
2121 timeout = null
2222 if ( lastArgs ) {
2323 result = func . apply ( context , lastArgs )
24+ // If the throttled function returns a promise, swallow rejections to
25+ // prevent unhandled promise rejections (the caller already .catch()'d
26+ // the leading-edge invocation and has no reference to trailing calls).
27+ if ( result && typeof ( result as any ) . catch === 'function' ) {
28+ ; ( result as any ) . catch ( ( ) => { } )
29+ }
2430 }
2531 context = null
2632 lastArgs = null
You can’t perform that action at this time.
0 commit comments