Skip to content

Commit 3db5c13

Browse files
committed
Amend debug.
1 parent ed9ed1b commit 3db5c13

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

app/controllers/ngsi-ld/weather.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function displayWeather(req, res) {
2020
);
2121
return res.render('weather', { title: weather.name, weather });
2222
} catch (error) {
23-
const errorDetail = error.error;
23+
const errorDetail = error.error || error;
2424
debug(errorDetail);
2525
// If no weather has been found, display an error screen
2626
return res.render('error', {

app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"scripts": {
6969
"pre-commit": "lint-staged",
7070
"start": "node ./bin/www",
71+
"no_devices": "DEBUG=tutorial.* DUMMY_OFF=false npm start",
7172
"lint": "eslint . --cache --fix",
7273
"prettier": "prettier --parser flow --config ./.prettierrc.json --write **/**/*.js **/*.js *.js",
7374
"test": "eslint ."

app/routes/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ router.get('/', async function (req, res) {
137137
ngsi: 'ngsi-ld'
138138
});
139139
} catch (e) {
140-
debug(e.error);
140+
const errorDetail = e.error || e;
141+
debug(errorDetail);
141142
return res.render('index', {
142-
errors: [e.error],
143+
errors: [errorDetail],
143144
buildings: [],
144145
pigs: [],
145146
cows: [],

0 commit comments

Comments
 (0)