Changeset 350e0689c0a0bb06d62d5d2e14994a86b53f04ad


Ignore:
Timestamp:
25.07.2013 22:32:05 (8 years ago)
Author:
Stanislaw Klekot <dozzie@…>
Branches:
b66903eafbcb1d49112014abc82c8bf683413db0
Children:
65833cfbc8cd22e548fb39ef1df828703341b919
Parents:
fb3b2360700705a52db0f6fe83f1b0171c217777
git-author:
Stanislaw Klekot <dozzie@…> (25.07.2013 22:32:05)
git-committer:
Stanislaw Klekot <dozzie@…> (25.07.2013 22:32:05)
Message:

Fixed error logging in loading and calling macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dashwiki/wiki/views.py

    r9d5d42 r350e06  
    3535  from django.core.exceptions import ObjectDoesNotExist 
    3636  from dashwiki.markup.ast import resolve_macros 
     37  import traceback # for traceback.format_exc() 
    3738 
    3839  def defer_return(result): 
     
    5354        'macro does not exist', 
    5455        ('macro_name', macro_name), 
    55         ('macro_args', macro_args), 
     56        #('macro_args', macro_args), # this is not known at this moment 
    5657        ('page_name',  page_name), 
     58        exception = { 
     59          'type': str(type(e)), 
     60          'message': str(e), 
     61          'traceback': traceback.format_exc(), 
     62        }, 
    5763      )) 
    5864      return defer_return( 
    59         error('macro ', tt(children[0], '()'), ' does not exist') 
     65        error('macro ', tt(macro_name, '()'), ' does not exist') 
    6066      ) 
    6167 
     
    6975          ('macro_args', macro_args), 
    7076          ('page_name',  page_name), 
    71           exception = { 'type': str(type(e)), 'message': str(e) }, 
     77          exception = { 
     78            'type': str(type(e)), 
     79            'message': str(e), 
     80            'traceback': traceback.format_exc(), 
     81          }, 
    7282        )) 
    73         return error('error when calling ', tt(str(macro_name), '()'), ': ', str(e)) 
     83        return error('error when calling ', tt(macro_name, '()'), ': ', str(e)) 
    7484 
    7585    return call_macro 
Note: See TracChangeset for help on using the changeset viewer.