Skip to content

Commit 6844cda

Browse files
authored
Merge pull request #9 from geodatagouv/tusbar/add-missing-error-handler
Add missing error handler
2 parents a3b1b17 + 76dda72 commit 6844cda

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/api/middlewares/ogr2ogr.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function getOptions(opts) {
9898
}
9999

100100
function downloadDataset(input, opts) {
101-
return (req, res) => {
101+
return (req, res, next) => {
102102
const projection = getProjection(req.query.projection)
103103
if (!projection) {
104104
throw new Http400('No valid projection given')
@@ -135,7 +135,10 @@ function downloadDataset(input, opts) {
135135
ogr._inDriver.output = opts.format
136136
}
137137

138-
ogr.stream().pipe(res)
138+
ogr
139+
.stream()
140+
.on('error', next)
141+
.pipe(res)
139142
}
140143
}
141144

0 commit comments

Comments
 (0)