public inbox for [email protected]  
help / color / mirror / Atom feed
From: Karsten Hilbert <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: Feature branches merged to master for 2.8 release
Date: Mon, 15 Oct 2018 14:11:55 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+mi_8aVzn-4Ujuqg5aMduHjL1XQ3Y7sUU86s3p6shMefaPoSQ@mail.gmail.com>
References: <CA+mi_8aVzn-4Ujuqg5aMduHjL1XQ3Y7sUU86s3p6shMefaPoSQ@mail.gmail.com>

On Mon, Oct 15, 2018 at 12:48:04PM +0100, Daniele Varrazzo wrote:

> - the new 'errors' module. About it I have a doubt: we convert
> postgres error messages [2] from lower_case to CamelCase because the
> latter is the convention for Python class, but maybe leaving as they
> are makes more sense? Easier to google for them or grep for them in
> the postgres sources maybe?

Since there is no Right or Wrong here, the "best" option
might be to offer both:

Raise whatever is Right for Python (that is, CamelCase)

	raise PostgresSpecificError

but support catching lower case, too:

	class postgres_specific_error(PostgresSpecificError):
		pass

	try:
		something()
	except postgres_specific_error:
		print('lower case')

For the lower case one I would exactly copy what's used by
PostgreSQL itself.

Make sense ?

Karsten
-- 
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B




view thread (20+ messages)  latest in thread

reply

Reply instructions:

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

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Feature branches merged to master for 2.8 release
  In-Reply-To: <[email protected]>

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

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox