14
14
* limitations under the License.
15
15
*/
16
16
17
- import { diag } from '@opentelemetry/api ' ;
17
+ import * as grpc from '@grpc/grpc-js ' ;
18
18
import * as protoLoader from '@grpc/proto-loader' ;
19
+ import { diag } from '@opentelemetry/api' ;
20
+ import { globalErrorHandler } from '@opentelemetry/core' ;
19
21
import { collectorTypes } from '@opentelemetry/exporter-collector' ;
20
- import * as grpc from '@grpc/grpc-js' ;
21
22
import * as path from 'path' ;
22
-
23
+ import { CollectorExporterNodeBase } from './CollectorExporterNodeBase' ;
23
24
import {
24
25
CollectorExporterConfigNode ,
25
26
GRPCQueueItem ,
26
- ServiceClientType ,
27
+ ServiceClientType
27
28
} from './types' ;
28
- import { CollectorExporterNodeBase } from './CollectorExporterNodeBase' ;
29
+
29
30
30
31
export function onInit < ExportItem , ServiceRequest > (
31
32
collector : CollectorExporterNodeBase < ExportItem , ServiceRequest > ,
@@ -38,7 +39,6 @@ export function onInit<ExportItem, ServiceRequest>(
38
39
39
40
const includeDirs = [ path . resolve ( __dirname , '..' , 'protos' ) ] ;
40
41
41
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
42
42
protoLoader
43
43
. load ( collector . getServiceProtoPath ( ) , {
44
44
keepCase : false ,
@@ -69,6 +69,9 @@ export function onInit<ExportItem, ServiceRequest>(
69
69
collector . send ( item . objects , item . onSuccess , item . onError ) ;
70
70
} ) ;
71
71
}
72
+ } )
73
+ . catch ( err => {
74
+ globalErrorHandler ( err ) ;
72
75
} ) ;
73
76
}
74
77
0 commit comments