Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix template not found #41

Closed
wants to merge 1 commit into from

Conversation

guileen
Copy link
Contributor

@guileen guileen commented Nov 24, 2015

if template not found return status 500 template not found.

@@ -160,6 +160,12 @@ Hbs.prototype.createRenderer = function() {
var tplPath = hbs.getTemplatePath(tpl),
template, rawTemplate, layoutTemplate;

if(tplPath === undefined) {
this.status = 500;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't a pattern I'm familiar with koa-hbs using. personally think it'd be better to throw here than anything. status = 500 doesn't really mean anything, does it? only thing that comes to mind is an http 500 error, which wouldn't be 'not found'.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellscape thank you for starting a discussion about this. I looked into this a bit more, and I agree with your suggestion. #42 is the tracking issue to utilize the standard koa error handling mechanisms.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to mention, there won't be a release with this change. There will be a new minor version once #42 closes.

@shellscape
Copy link
Contributor

Will be implementing a proper throw with version 0.9.0.

@shellscape shellscape closed this Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants