Rename error middleware

This commit is contained in:
Daniel García Aubert
2017-11-02 18:38:34 +01:00
parent 1d08734721
commit 08b91f935d
+8 -8
View File
@@ -61,9 +61,9 @@ MapController.prototype.register = function(app) {
includeQuery: true
}),
respond,
mapErrorMiddleware({
augmentError({
label: 'ANONYMOUS LAYERGROUP',
augmentError: true
addContext: true
})
);
app.post(
@@ -78,9 +78,9 @@ MapController.prototype.register = function(app) {
includeQuery: true
}),
respond,
mapErrorMiddleware({
augmentError({
label: 'ANONYMOUS LAYERGROUP',
augmentError: true
addContext: true
})
);
app.get(
@@ -95,7 +95,7 @@ MapController.prototype.register = function(app) {
useTemplateHash: true
}),
respond,
mapErrorMiddleware({
augmentError({
label: 'NAMED MAP LAYERGROUP'
})
);
@@ -111,7 +111,7 @@ MapController.prototype.register = function(app) {
useTemplateHash: true
}),
respond,
mapErrorMiddleware({
augmentError({
label: 'NAMED MAP LAYERGROUP'
})
);
@@ -584,8 +584,8 @@ MapController.prototype.addWidgetsUrl = function(username, layergroup, mapConfig
}
};
function mapErrorMiddleware (options) {
const { augmentError = false, label = 'MAPS CONTROLLER' } = options;
function augmentError (options) {
const { addContext = false, label = 'MAPS CONTROLLER' } = options;
return function mapError (err, req, res, next) {
const { mapconfig } = res.locals;