Project

General

Profile

Bug #18345

Better rescue from syntax error in template rendering

Added by Marek Hulán over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
Difficulty:
Triaged:
Bugzilla link:

Description

In unsafe mode rendering, SyntaxError can be raised, which is normally not caught. In this specific case, we should be able to rescue even from syntax errors to avoid ugly error pages.

Also we should set proper context so we can get at least the number of line where the error occurred. This is possible only in unsafe mode but better than nothing.


Related issues

Related to Foreman - Bug #9695: Clearer template errors should be given during build reviewNew2015-03-10

Associated revisions

Revision 3a766513 (diff)
Added by Marek Hulán over 4 years ago

Fixes #18345 - Improve templates error handling

History

#1 Updated by Marek Hulán over 4 years ago

  • Related to Bug #9695: Clearer template errors should be given during build review added

#2 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4247 added

#3 Updated by Marek Hulán over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 209

#5 Updated by The Foreman Bot over 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/4366 added

Also available in: Atom PDF