equal
deleted
inserted
replaced
|
1 # A dummy extension that installs an hgweb command that throws an Exception. |
|
2 |
|
3 from mercurial.hgweb import webcommands |
|
4 |
|
5 def raiseerror(web, req, tmpl): |
|
6 '''Dummy web command that raises an uncaught Exception.''' |
|
7 |
|
8 # Simulate an error after partial response. |
|
9 if 'partialresponse' in req.form: |
|
10 req.respond(200, 'text/plain') |
|
11 req.write('partial content\n') |
|
12 |
|
13 raise AttributeError('I am an uncaught error!') |
|
14 |
|
15 def extsetup(ui): |
|
16 setattr(webcommands, 'raiseerror', raiseerror) |
|
17 webcommands.__all__.append('raiseerror') |