Skip to content

Commit 43416a8

Browse files
committed
WIP
1 parent 17aa899 commit 43416a8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/rest-exe-errors.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ const byErrorCode = Object.assign(Object.create(null), {
146146
message: 'trip is cancelled',
147147
props: {
148148
},
149-
}
149+
},
150150
})
151151

152+
// todo: "server returned bogus data" error
153+
152154
export {
153155
// all from ./errors.js
154156
ACCESS_DENIED,

parse-rest/trip.js

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const parseTrip = (ctx, t) => {
1010

1111
const stopovers = sortBy(t.stops || [], 'routeIdx')
1212
.map(st => profile.parseStopover(ctx, st))
13+
if (stopovers.length === 0) {
14+
// todo: throw "server returned bogus data" error
15+
}
16+
1317
const dep = stopovers[0]
1418
const arr = last(stopovers)
1519

0 commit comments

Comments
 (0)