FND / tiddlywebplugins.bfw

Barely Functioning Wiki, emphasizing micro-content
0 stars 2 forks source link

500 errors due to missing parameters #9

Open FND opened 11 years ago

FND commented 11 years ago

currently processing of incoming parameters does not take into account the possibility of individual parameters being omitted, thus easily raising a 500 error: https://github.com/FND/tiddlywebplugins.bfw/blob/7ce7876519351ff24755f9c324ea77ee3317ef37/tiddlywebplugins/bfw/web.py#L38

so instead of

param = environ['tiddlyweb.query'][param][0]

we should use something like

param = environ['tiddlyweb.query'].get(param, default)[0]

or wrap all parameter processing into try...except