Did I find the right examples for you? yes no

All Samples(32)  |  Call(25)  |  Derive(0)  |  Import(7)
Class used to pass a minor error from code performing an action to code
which displays errors to the user.

The message stored in such an exception should be raw HTML, as passed to
the browser.  Any content in this message resulting from user inputs, MUST
be HTML encoded (probably using HTMLUtils.encodeText()) to avoid risk of
cross-site scripting attacks.

For convenience, extra arguments may be provided which will be encoded and
then merged with the message using the % operator.  For example:(more...)

src/x/a/xappy-0.5/perftest/parse_wikipedia/XMLUtils.py   xappy(Download)
            except:
                pass
        raise Errors.UserError("at line %%s, column %%s%s: %%s" % context,
                               e.lineno, e.offset,
                               xml.parsers.expat.ErrorString(e.code))
            except:
                pass
        raise Errors.UserError("at line %%s, column %%s%s: %%s" % context,
                               e.getLineNumber(), e.getColumnNumber(),
                               e.getMessage())
    except ValueError, e:
        raise Errors.UserError("Parse error: %s", str(e))
                handle = open(fh)
            except IOError, e:
                raise Errors.UserError("Can't open file <q>%s</q>: %s", fh, str(e))
            fh = handle
 

src/x/a/xappy-0.5/perftest/parse_wikipedia/wiki2dump.py   xappy(Download)
import os.path
from XMLUtils import ParsedXmlFile
from Errors import UserError
import re
 
 
    if os.path.exists(outfile):
        raise UserError("Error: output file \"%s\" already exists.", outfile)
    if os.path.exists(redirfile):
        raise UserError("Error: redirections output file \"%s\" already exists.", redirfile)
        if state == 0:
            if item.type != item.START:
                raise UserError('Didn\'t get correct header at start of file')
            else:
                state = 1