Skip to content

Commit 4288e29

Browse files
committed
Remove invalid code
1 parent 21a0b38 commit 4288e29

File tree

3 files changed

+15
-57
lines changed

3 files changed

+15
-57
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ npm install trackingmore-sdk-nodejs
2929
const TrackingMore = require('trackingmore-sdk-nodejs')
3030
const key = 'you api key'
3131
const trackingmore = new TrackingMore(key)
32-
try {
33-
trackingmore.couriers.getAllCouriers()
34-
.then(result => console.log(result))
35-
.catch(e => console.log(e))
36-
} catch (error) {
37-
console.error('An error occurred:', error.message)
38-
}
32+
33+
trackingmore.couriers.getAllCouriers()
34+
.then(result => console.log(result))
35+
.catch(e => console.error('An error occurred:', e.message))
3936
```
4037

4138
## Testing
@@ -48,14 +45,10 @@ npm run test or npm test
4845
Simply add a try-catch block
4946

5047
```javascript
51-
try {
52-
// Get all couriers (couriers/all)
53-
trackingmore.couriers.getAllCouriers()
54-
.then(result => console.log(result))
55-
.catch(e => console.log(e))
56-
} catch (error) {
57-
console.error('An error occurred:', error.message)
58-
}
48+
// Get all couriers (couriers/all)
49+
trackingmore.couriers.getAllCouriers()
50+
.then(result => console.log(result))
51+
.catch(e => console.error('An error occurred:', e.message))
5952

6053
```
6154

example/example.js

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,20 @@ const key = 'you api key'
44
const trackingmore = new TrackingMore(key)
55

66

7-
try {
8-
// Get all couriers (couriers/all)
9-
trackingmore.couriers.getAllCouriers()
10-
.then(result => console.log(result))
11-
.catch(e => console.log(e))
12-
} catch (error) {
13-
console.error('An error occurred:', error.message)
14-
}
7+
// Get all couriers (couriers/all)
8+
trackingmore.couriers.getAllCouriers()
9+
.then(result => console.log(result))
10+
.catch(e => console.log(e))
11+
1512

1613

17-
// try {
1814
// // Detect courier (couriers/detect)
1915
// const params = {'tracking_number': ''}
2016
// trackingmore.couriers.detect(params)
2117
// .then(result => console.log(result))
2218
// .catch(e => console.log(e))
23-
// } catch (error) {
24-
// console.error('An error occurred:', error.message)
25-
// }
2619

2720

28-
// try {
2921
// // Create a Tracking (trackings/create)
3022
// const params = {
3123
// 'tracking_number': '9400111899562537624326',
@@ -39,12 +31,8 @@ try {
3931
// trackingmore.trackings.createTracking(params)
4032
// .then(result => console.log(result))
4133
// .catch(e => console.log(e))
42-
// } catch (error) {
43-
// console.error('An error occurred:', error.message)
44-
// }
4534

4635

47-
// try {
4836
// // Get results (trackings/get)
4937
// // const params = {
5038
// // 'tracking_numbers': '9400111899562537624656',
@@ -61,12 +49,8 @@ try {
6149
// trackingmore.trackings.getTrackingResults(params)
6250
// .then(result => console.log(result))
6351
// .catch(e => console.log(e))
64-
// } catch (error) {
65-
// console.error('An error occurred:', error.message)
66-
// }
6752

6853

69-
// try {
7054
// // Create trackings (trackings/batch)
7155
// const params = [{
7256
// 'tracking_number': '9400111899562537680047',
@@ -78,11 +62,7 @@ try {
7862
// trackingmore.trackings.batchCreateTrackings(params)
7963
// .then(result => console.log(result))
8064
// .catch(e => console.log(e))
81-
// } catch (error) {
82-
// console.error('An error occurred:', error.message)
83-
// }
8465

85-
// try {
8666
// // Update a Tracking by ID (trackings/update)
8767
// const params = {
8868
// 'customer_name': 'New name',
@@ -92,40 +72,25 @@ try {
9272
// trackingmore.trackings.updateTrackingByID(idString, params)
9373
// .then(result => console.log(result))
9474
// .catch(e => console.log(e))
95-
// } catch (error) {
96-
// console.error('An error occurred:', error.message)
97-
// }
9875

9976

100-
// try {
10177
// // Delete Tracking by ID (trackings/delete)
10278
// const idString = "9a135b15b5d983e1d8950d99022db0c7"
10379
// trackingmore.trackings.deleteTrackingByID(idString)
10480
// .then(result => console.log(result))
10581
// .catch(e => console.log(e))
106-
// } catch (error) {
107-
// console.error('An error occurred:', error.message)
108-
// }
10982

11083

111-
// try {
11284
// // Retrack expired Tracking by ID (trackings/retrack)
11385
// const idString = "99f4ed7fc73aa83fe68fd69ab6458b28"
11486
// trackingmore.trackings.retrackTrackingByID(idString)
11587
// .then(result => console.log(result))
11688
// .catch(e => console.log(e))
117-
// } catch (error) {
118-
// console.error('An error occurred:', error.message)
119-
// }
12089

121-
// try {
12290
// // Create an air waybill (awb)
12391
// const params = {
12492
// 'awb_number': '235-69030430',
12593
// }
12694
// trackingmore.airWaybills.createAnAirWayBill(params)
12795
// .then(result => console.log(result))
128-
// .catch(e => console.log(e))
129-
// } catch (error) {
130-
// console.error('An error occurred:', error.message)
131-
// }
96+
// .catch(e => console.log(e))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trackingmore-sdk-nodejs",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "node.js SDK for TrackingMore API",
55
"main": "src/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)