File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @traceo-sdk/browser" ,
3- "version" : " 0.31.9 " ,
3+ "version" : " 0.31.14 " ,
44 "main" : " dist/index.js" ,
55 "types" : " dist/index.d.ts" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ export class FetchTransport<T> implements ITransport {
1414 body : JSON . stringify ( this . _options . body )
1515 } ;
1616
17- await fetch ( this . _options . url , options ) ;
17+ try {
18+ await fetch ( this . _options . url , options ) ;
19+ } catch ( error ) {
20+ throw new Error (
21+ `[Traceo SDK] Cannot send data to Traceo Platform. Make sure the application is running. Caused by: ${ error } `
22+ ) ;
23+ }
1824 }
1925}
Original file line number Diff line number Diff line change @@ -11,12 +11,8 @@ export class Transport {
1111 }
1212
1313 public send < T > ( body : T , headers : Dictionary < string > ) {
14- try {
15- const options = this . requestOptions < T > ( body , headers ) ;
16- this . transport < T > ( options ) . request ( ) ;
17- } catch ( error ) {
18- console . log ( "Error sending data to traceo: " , error ) ;
19- }
14+ const options = this . requestOptions < T > ( body , headers ) ;
15+ this . transport < T > ( options ) . request ( ) ;
2016 }
2117
2218 private transport < T > ( options : RequestOptions < T > ) {
You can’t perform that action at this time.
0 commit comments