Skip to content

Commit

Permalink
harp version now in error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed Dec 18, 2013
1 parent 57f578f commit 3492ba7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ var custom404dynamic = function(req, rsp, next){
var default404 = function(req, rsp, next){
var locals = {
project: req.headers.host,
name: "Page Not Found"
name: "Page Not Found",
pkg: pkg
}
polymer.root(__dirname + "/templates").render("404.jade", locals, function(err, body){
var type = helpers.mimeType("html")
Expand Down Expand Up @@ -385,7 +386,8 @@ exports.setup = function(req, rsp, next){

var locals = {
project: req.headers.host,
error: error
error: error,
pkg: pkg
}

return polymer.root(__dirname + "/templates").render("error.jade", locals, function(err, body){
Expand All @@ -411,7 +413,8 @@ var poly = exports.poly = function(req, rsp, next){
error.stack = helpers.stacktrace(error.stack, { lineno: error.lineno })
var locals = {
project: req.headers.host,
error: error
error: error,
pkg: pkg
}
return polymer.root(__dirname + "/templates").render("error.jade", locals, function(err, body){
rsp.statusCode = 500
Expand Down Expand Up @@ -448,7 +451,8 @@ exports.process = function(req, rsp, next){

var locals = {
project: req.headers.host,
error: error
error: error,
pkg: pkg
}
if(polymer.helpers.outputType(sourceFile) == 'css'){
var outputType = polymer.helpers.outputType(sourceFile)
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/_layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ html(lang="en")
body
!= yield
footer
p Harp <span class="version">v0.9.4</span> &nbsp;
p Harp <span class="version">v#{ pkg.version }</span> &nbsp;
a(href="http://harpjs.com/docs/", target="_blank") Documentation
1 change: 1 addition & 0 deletions test/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe("errors", function(){
it("should get error message for invalid harp.json", function(done){
request('http://localhost:'+ port +'/', function (e, r, b) {
r.statusCode.should.eql(500)
b.should.include(harp.pkg.version)
harp.compile(projectPath, outputPath, function(error){
should.exist(error)
error.should.have.property("source")
Expand Down

0 comments on commit 3492ba7

Please sign in to comment.