-
Notifications
You must be signed in to change notification settings - Fork 275
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
renderFile method swallows errors #509
Comments
In https://github.com/twigjs/twig.js/blob/master/src/twig.exports.js#L162, add a new property to the Make a PR and I'll merge. |
If you use the synchonous read with "fs.statSync" by using the following option: let params = {
settings: { "twig options": { async: false} }
};
Twig.renderFile( "xyz", params, console.log); Then all errors will be thrown correctly. https://github.com/twigjs/twig.js/blob/master/src/twig.loader.fs.js#L50 is never beeing called, so passing a func for "error_callback" in: https://github.com/twigjs/twig.js/blob/master/src/twig.loader.fs.js#L52 seems not to solve the problem... |
@dave-irvine it's still affecting |
is there any work around for this? |
@r3wt yes, use twing instead, is better written |
This comment was marked as abuse.
This comment was marked as abuse.
@Friksel This is an open source project. Feel free to contribute and fix this issue! |
@Friksel if its such a minor fix, I look forward to your open source contribution. I believe I actually wrote instructions for how to fix this in 2017, yet nobody ever made a pull request implementing my suggestion. |
This comment was marked as abuse.
This comment was marked as abuse.
Checking through your comment history on other projects, I can see you are not someone I want to interact with. Please enjoy open source responsibly. |
@Friksel The reason it isn't fixed is because twig.js, and other templating libraries have pretty much run their course. in the modern day, we have react which is used on the frontend, so really the only use for twig.js these days is maybe for email templating. its easy to see why there wasn't enough developer need to fix this, as its simply a non factor as long as the template exists. I will disagree with you though @dave-irvine blocking @Friksel over these minor comments was a bit of an overreaction on your part. I would kindly ask you to cool off and consider rescinding the ban. I would also like to ask @Friksel to remain respectful in the future when commenting. As someone who has been hotheaded on github plenty of times, i can tell you its not a good look for employers when evaluating your resume. They do due diligence on candidates including investigating their behavior on github and stack overflow, so try to keep that in mind when using these platforms. |
I'm agreeing with @dave-irvine on this matter. Maintaining open source software requires a lot of effort, least of which is community management. No tolerance for ignorant people in the issue queue. We aren't working on twig.js full time, so have empathy. To address your second point, I would hire dave-irvine because of this action. It shows leadership and a desire to keep things positive in a team setting. |
2 things:
To be fair, i could have started a new paragraph to make it clearer. i haven't really thought about the rules of writing for some time, thanks for the reminder. |
Hi @r3wt, I appreciate you leaving feedback on this situation. Regarding your thoughts on whether I overreacted; I have little to no acceptance of toxicity in the open-source community, the Internet is a cesspool of toxicity as it is, and I see no reason to subject myself to it in places where I try to conduct my work. In this particular case, while the two comments the user made in isolation may not seem particularly toxic, I had made a further investigation into the user's other comments on open source projects and made my decision based on this. Regarding your thoughts on rescinding the block; as I am not the only maintainer on this project I opened a secondary issue to discuss this block here: #772 and left it to the other maintainers to decide if I had overreacted in this case and whether they wished to remove the block. In truth this is the first time I've had to take such an action, let alone in the Twig.js community. Its possible we may need community guidelines to deal with future issues, but in retrospect I would probably take the same action again. Toxicity has no place in open source. End of story IMO. |
Calling
Twig.renderFile
with an invalid file path results in the callback not being executed.For example,
If
templatePath
is incorrect then the specified callback never gets fired and no error is thrown either meaning I have no way to handle errors.The text was updated successfully, but these errors were encountered: