Skip to content
Browse files

Fix error handler ctx

  • Loading branch information...
1 parent c1d43fb commit 50b898eff4e775cacc7b37cf0f6bceb1b4db4a16 @eldargab committed
Showing with 7 additions and 2 deletions.
  1. +1 −1 lib/app.js
  2. +6 −1 test/app.js
View
2 lib/app.js
@@ -84,7 +84,7 @@ App.prototype._raise = function (p, e) {
if (parent == p) parent = ''
} while (!handler)
- var proxy = p && (new Proxy(this, p))
+ var proxy = p ? new Proxy(this, p) : this
function raise (err) {
if (err == null) return
View
7 test/app.js
@@ -269,8 +269,13 @@ describe('App', function () {
throw 'error'
})
- app.onerror('foo', function () {
+ app.onerror('foo', function (err) {
this.get('&/bar').should.equal('bar')
+ throw err
+ })
+
+ app.onerror(function () {
+ this.should.equal(app)
done()
})

0 comments on commit 50b898e

Please sign in to comment.
Something went wrong with that request. Please try again.