Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Error handing when using plugins

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
TedK
Smarty n00b


Joined: 12 Sep 2019
Posts: 4

PostPosted: Tue Sep 24, 2019 11:44 am    Post subject: Error handing when using plugins Reply with quote

I created plugins so I can add data to the templates initiated from the templates. One of the plugins has an external and not always stable data source. Now I want to trigger an error in the template when the data source is not available. In V2 there was $smarty->trigger_error. What is the replacement of this in V3? Or what is the best way to return an error to the template?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Oct 02, 2019 8:55 pm    Post subject: Reply with quote

Depends, how severe you consider the problem, you can handle it in the plugin or just throw an exception.
There's no reason anything like that should exists in the templating engine.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP