[PATCH] Convert bundle errors from Exception to BzrNewError
Hermann Kraus
hermann at physiklaborant.de
Sun Aug 6 18:21:49 BST 2006
On Sun, 06 Aug 2006 00:03:03 +0200, Aaron Bentley
<aaron.bentley at utoronto.ca> wrote:
> Thanks for your patch. I created those errors that way because they're
> intended to be caught, not seen by the user, but perhaps that's naive.
> There's certainly no harm in making them consistent.
I wanted to output error messages like this:
"bzr: ERROR: Error reading bundle: Malformed bzr revision-bundle header:
'Extra characters after version number'"
So the user has at least some indication of what's wrong. BTW: It might be
good to extend this message to tell the user that the problem might be a
bundle with '\r\n' lineendings. But I'm not sure if the exception text is
the right place to do it.
> There are a few style issues:
> The line you changed to give a message to MalformedHeader is more than
> 79 character wide. It should be split and/or rewritten.
I've changed this and also some other lines that were too long. Nearly
everywhere in bundle/serializer/__init__.py lines with exception text were
longer than 80characters.
> The spacing between classes in errors.py is not consistent. There
> should always be two blank lines between classes, and none after
> MalformedFooter, because it's the last class in the file.
Fixed.
> Also, please don't don't use the file extension ".bundle" when attaching
> bundles. This causes your mail client to treat it as a binary file,
> which makes it awkward for us to read, and means that the source code
> doesn't appear in replies. I suggest ".patch" or ".diff".
I tried both, but it always gave "Content-Type:
application/octet-stream;". So I'm using .txt now which gives
"Content-Type: text/plain;"
Hermann
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: errors.txt
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060806/2b9fa09f/attachment.txt
More information about the bazaar
mailing list