Fix WebAPIError.with_message, and add WebAPIError.with_override.

Review Request #4622 — Created Sept. 21, 2013 and submitted — Latest diff uploaded

Information

Djblets
master

Reviewers

Fix WebAPIError.with_message, and add WebAPIError.with_override.

WebAPIError.with_message modified the main instance of an error, instead
of creating a copy. This led to pollution of the error instances. In
practice, Djblets and Review Board aren't bit by it, by this may change
over time. Now it creates a copy.

Since it's also useful to override headers, a new with_override function
has been added that takes message and headers. with_message now just
wraps this.

New unit tests pass.