Ignore:
Timestamp:
15/05/07 16:04:20 (13 years ago)
Author:
spascoe
Message:

Implemented basic query string handling by editing base.BaseController?.
Created an exception report template.
Disabled error document middleware.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_common/exception_report.py

    r2475 r2479  
    1818 
    1919    """ 
    20     def __init__(self, version, exceptions, lang=None): 
     20    def __init__(self, exceptions, version, lang=None): 
    2121        self.version = version 
    2222        self.exceptions = exceptions 
     
    3333 
    3434    """ 
    35     def ___init__(self, code, text=None, locator=None): 
     35    def __init__(self, code, text=None, locator=None): 
    3636        self.code = code 
    3737        self.text = text 
    3838        self.locator = locator 
     39 
     40class OwsError(Exception): 
     41    """Wrapper for triggering ExceptionReports via raise. 
     42 
     43    @todo: Design an elegant way of setting the version framework-wide. 
     44    @ivar report: The ExceptionReport describing the error. 
     45     
     46    """ 
     47    def __init__(self, code, text=None, locator=None, version='1.1.0', lang=None): 
     48        self.report = ExceptionReport([OwsException(code, text, locator)], version, lang) 
     49 
     50    def __str__(self): 
     51        """A concise non-XML representation of the error 
     52        """ 
     53        e = self.report.exceptions[0] 
     54        return '%s: %s (%s)' % (e.code, e.text, e.locator) 
Note: See TracChangeset for help on using the changeset viewer.