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

A better solution for PR 129 #171

Merged
merged 1 commit into from
Jun 2, 2016
Merged

A better solution for PR 129 #171

merged 1 commit into from
Jun 2, 2016

Conversation

Spikef
Copy link
Contributor

@Spikef Spikef commented May 28, 2016

The PR 129 fixed issue 119, but would lost the include line's error information(such as his sample, we can't get error 'ejs/sample/index.html:18'). On the other way, his solution would make error filename wrong when you use both <%include('header.html')%> and <%-include body.html%>.

So I think this solution makes things better. After using this PR, as his sample, the error information displays as bellow.

ReferenceError: /Users/Spikef/ejs/sample/index.html:18
   16| this_variable_is_not_defined is not defined
   17| -->
>> 18| <% include body.html %>
   19| </body>
   20| </html>

/Users/Spikef/ejs/sample/body.html:2
   1| <!-- Execute an exception -->
>> 2| <p><%= this_variable_is_not_defined %></p>

The [PR 129](#129) fixed issue 119, but would lost the include line's error information(such as his sample, we can't get error 'ejs/sample/index.html:18'). On the other way, his solution would make error filename wrong when you use both <%include('header.html')%> and <%-include body.html%>.

So I think this solution makes things better. After using this PR, as his sample, the error information displays as bellow.

ReferenceError: /Users/Spikef/ejs/sample/index.html:18
   16| this_variable_is_not_defined is not defined
   17| -->
>> 18| <% include body.html %>
   19| </body>
   20| </html>

/Users/Spikef/ejs/sample/body.html:2
   1| <!-- Execute an exception -->
>> 2| <p><%= this_variable_is_not_defined %></p>
@RyanZim
Copy link
Collaborator

RyanZim commented May 28, 2016

I'll check this out when I get time. If @TimothyGu beats me to it, that's fine.

@RyanZim
Copy link
Collaborator

RyanZim commented May 30, 2016

LGTM; CC @mde & @TimothyGu for peer review.

We will probably never get perfect error handling, but this helps.

@mde mde merged commit 19ddb28 into mde:master Jun 2, 2016
@mde
Copy link
Owner

mde commented Jun 2, 2016

Thanks!

@RyanZim
Copy link
Collaborator

RyanZim commented Jun 2, 2016

BTW @mde, when are you planning for the next release?

@Spikef
Copy link
Contributor Author

Spikef commented Jun 5, 2016

Thanks for the merge.

@Spikef Spikef mentioned this pull request Jun 12, 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.

3 participants