unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: Justus Winter <4winter@informatik.uni-hamburg.de>,
	notmuch@notmuchmail.org
Subject: Re: [PATCH 1/9] python: add a .gitignore file and refine the toplevel one
Date: Thu, 29 Sep 2011 09:45:38 +0200	[thread overview]
Message-ID: <871uuzlrkt.fsf@SSpaeth.de> (raw)
In-Reply-To: <1316999137-28257-1-git-send-email-4winter@informatik.uni-hamburg.de>

[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]

On Mon, 26 Sep 2011 03:05:29 +0200, Justus Winter wrote:

#1) APPLIED
#2) APPLIED
#3) reorder the arguments of NotmuchError.__init__(): NOT APPLIED

The python tutorial gives an example of custom TransitionError with
three arguments, a custom message as the third. In addition, a STATUS
value is always expected to be given, while the additional explanatory
msg is optional, so STATUS makes for a more logical 1st parameter IMHO.
Even if it were the case, it makes for lots of code churn, longer code
(status=foo) to all Exceptions, and existing third party code would be
broken. Overall, I think there is more potential for trouble than
cleanup.

#4) APPLIED
status is always expected to be existing, but bullet proofing never hurts,
so this patch makes sense.

#5&#6) APPLIED
Modified the patches to apply again, as some changes had been made.

#7) NOT APPLIED, INPUT SOUGHT :)
I do see the value of more fine grained exceptions, but I am not sure,
we need this level of fine-grainedness. It would also make things more
tricky (the API is still actively evolving, and e.g. 4 days ago, a new
error status was added), so users of the bindings would now have
 +    NotmuchError,
 +    OutOfMemoryError,
 +    ReadOnlyDatabaseError,
 +    XapianError,
 +    FileError,
 +    FileNotEmailError,
 +    DuplicateMessageIdError,
 +    NullPointerError,
 +    TagTooLongError,
 +    UnbalancedFreezeThawError,
 +    UnbalancedAtomicError,
 +    NotInitializedError

to check where e.g. Xapian could also hide an Out of Memory. Do people
really want to catch, say UnbalancedAtomic errors specifically, rather
than testing whether an operation succeeded, and check the status code
if not? I could see the case for NotInitializedError, as that is a bit
specific to the python bindings and users might want to catch it separately.

Also, not all "status" are an error, e.g. DuplicateMessageId denotes
success rather than failure, it just communicates a status.

What do people (&user of the bindings) think would make sense here?
I am not opposed, but want more discussion and input before such a
change is made.

#8) Not merged, as it depends on #7

#9) APPLIED

Thanks for the patches, most of them are quite nice. For 7&8, I'd like
to hear more opinions.

Sebastian

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2011-09-29  7:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26  1:05 [PATCH 1/9] python: add a .gitignore file and refine the toplevel one Justus Winter
2011-09-26  1:05 ` [PATCH 2/9] python: add status and message attributes to NotmuchError Justus Winter
2011-09-26  1:05 ` [PATCH 3/9] python: reorder the arguments of NotmuchError.__init__() Justus Winter
2011-09-26  1:05 ` [PATCH 4/9] python: fix NotmuchError.__str__ if status == None Justus Winter
2011-09-26  1:05 ` [PATCH 5/9] python: rename _verify_initialized_db to _assert_db_is_initialized Justus Winter
2011-09-26  1:05 ` [PATCH 6/9] python: rename _verify_dir_initialized to _assert_dir_is_initialized Justus Winter
2011-09-26  1:05 ` [PATCH 7/9] python: provide more exception classes Justus Winter
2011-09-30 12:00   ` Sebastian Spaeth
2011-09-30 12:23     ` Justus Winter
2011-09-26  1:05 ` [PATCH 8/9] python: use the new exception classes and update the documentation Justus Winter
2011-09-26  1:05 ` [PATCH 9/9] python: raise a more specific error in Messages.print_messages Justus Winter
2011-09-29  7:45 ` Sebastian Spaeth [this message]
2011-09-30  0:41   ` [PATCH 1/9] python: add a .gitignore file and refine the toplevel one Justus Winter
2011-09-30  9:14     ` Sebastian Spaeth
2011-09-29  7:47 ` Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871uuzlrkt.fsf@SSpaeth.de \
    --to=sebastian@sspaeth.de \
    --cc=4winter@informatik.uni-hamburg.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).