Skip to content

Commit

Permalink
💄 Return Error message
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed May 6, 2015
1 parent 1f1a286 commit 02e7cb4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/index.coffee
Expand Up @@ -21,7 +21,7 @@ turnoutMiddleware= (options={})->
res.end html
.catch (error)->
res.status 403
res.end error.toString()
res.end error.message ? error

router

Expand Down
6 changes: 3 additions & 3 deletions lib/turnout.coffee
Expand Up @@ -13,7 +13,7 @@ class Turnout
@options.blacklist?= []
@options.whitelist?= []

@options.timeout?= 2000
@options.timeout?= 3000
@options.eventName?= 'expressTurnoutRendered'

debug 'new Turnout',@options
Expand Down Expand Up @@ -60,8 +60,8 @@ class Turnout
debug 'Execute '+script

exec script,(error,stdout)->
resolve stdout unless error?
reject error if error?
resolve stdout.trim() unless error?
reject stdout.trim() if error?

getUri: (req)->
uri= req.protocol+'://'+req.get('host')+req.originalUrl
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"postinstall": "coffee -o src -c lib",

"test": "jasminetea test --verbose --cover --report --lint --timeout 2500"
"test": "jasminetea test --verbose --cover --report --lint --timeout 3500"
},

"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/options.spec.coffee
Expand Up @@ -149,7 +149,7 @@ describe 'Options',->
.spread (response)->
expect(response.statusCode).toBe 403
expect(response.headers['x-powered-by']).toBe 'Express-turnout'
expect(response.body).toBe 'Timeout'
expect(response.body).toBe 'Timeout by 1ms'

done()

Expand Down

0 comments on commit 02e7cb4

Please sign in to comment.