简体   繁体   English

模板命名错误的流星错误处理

[英]Meteor error handling for template naming typo errors

Recently I had an error with a name being used in a helpers file. 最近,我在助手文件中使用名称时出错。 Because the template name being used was not valid, all my global helpers stopped working (Template.registerHelper()). 因为使用的模板名称无效,所以我所有的全局助手都停止工作(Template.registerHelper())。 In the past I have faced similar circumstances where one naming error causes my entire web app to crash. 在过去,我遇到过类似的情况,其中一个命名错误导致我的整个Web应用程序崩溃。

Is there a way to handle error so that it does not affect other JS files? 有没有一种方法可以处理错误,使其不影响其他JS文件?

The error just is from naming issues and is 该错误只是来自命名问题,是

Uncaught TypeError: Cannot read property 'helpers' of undefined. Uncaught TypeError:无法读取未定义的属性“ helpers”。

Basically i'm asking how can I prevent my WHOLE app from breaking when one js file is erroring. 基本上我问的是当一个js文件出错时如何防止我的WHOLE应用程序损坏。

I asked this very same question on the meteor forums. 我在流星论坛上问了同样的问题。 The response was that the feature is not available yet and it is bad practice anyway to leave your application in a state where it runs with errors. 响应是该功能尚不可用,并且将应用程序保持在错误运行状态的做法仍然是不明智的做法

https://forums.meteor.com/t/entire-app-breaks-when-one-file-errors/19431 https://forums.meteor.com/t/entire-app-breaks-when-one-file-errors/19431

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM