title: Jinja2 Exception Handling
body: <p>Is there a way to handle exceptions within a template in jinja2?</p>
  
  <pre><code>{% for item in items %}
     {{ item|urlencode }}  &lt;-- item contains a unicode string that contains a character causes urlencode to throw KeyError
  {% endfor %}
  </code></pre>
  
  <p>How do I handle that exception so that I can just skip that item or handle it without forcing the entire template rendering to fail?</p>
  
  <p>Thanks!</p>