ctx.error -> ctx.throw

and new middleware signature