Throw useful error to stderr when graylog is not enabled

RESOLVED FIXED

Status

Webmaker
webmaker.org
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jbuck, Assigned: jbuck)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Right now if you don't define the GRAYLOG_HOST variable and there's a crash in the serverside js, the server just spits out the following error:

ReferenceError: graylogHost is not defined
    at reportError (/Users/jon/Sites/webmaker.org/app.js:65:9)
    at Object.app.use.res.render.code [as handle] (/Users/jon/Sites/webmaker.org/app.js:184:3)
    at next (/Users/jon/Sites/webmaker.org/node_modules/express/node_modules/connect/lib/proto.js:185:17)
    at next (/Users/jon/Sites/webmaker.org/node_modules/express/node_modules/connect/lib/proto.js:187:11)
    at pass (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:107:24)
    at nextRoute (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:100:7)
    at callbacks (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:164:11)
    at callbacks (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:167:9)
    at param (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:135:11)
    at pass (/Users/jon/Sites/webmaker.org/node_modules/express/lib/router/index.js:142:5)

This makes local dev debugging difficult.
Attachment #799740 - Flags: review?(ali) → review+

Updated

5 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.