tiddlyweb / tiddlywebplugins.form

Adds POST and binary file upload (via HTML) support to TiddlyWeb
2 stars 3 forks source link

Don't use HTTP400 inside the serialization #2

Closed cdent closed 12 years ago

cdent commented 12 years ago

At https://github.com/bengillies/tiddlywebplugins.form/blob/master/tiddlywebplugins/form.py#L107 HTTP400 is used. TiddlerFormatError is probably a better choice.

It's generally a bad idea to use HTTP exceptions inside the serializations as that assumes a use context which may not be true.

cdent commented 12 years ago

Hmm. NoSerializationError might be better.

Because if a form isn't active then the serialization ought not exist at all. Not sure which is better.

bengillies commented 12 years ago

I've gone with NoSerializationError, which seemed like a better option.