This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author danielsh
Recipients danielsh, ezio.melotti, ghaering, levkivskyi, sleepycal, torsten
Date 2015-08-24.10:49:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440413362.29.0.335526734336.issue16379@psf.upfronthosting.co.za>
In-reply-to
Content
> What's the reasoning behind offering a error code to name mapping?

Allowing code that runs into an error to print the error name rather than its
numeric value.  This saves whoever reads the error message having to look it up
himself.

> his seem problematic to me. In case a newer SQLite version introduces a new
> error code, this error code cannot be found in the mapping. I propose to
> leave this out in order to not have this problem.
> 
> Otherwise we will have people depending on any error code being able to be
> found in this mapping.

Then people shouldn't depend on the mapping being complete.  Let's keep the
mapping and document that people should only use it as
`sqlite3.errorcode.get(...)`, never as `sqlite3.errorcode[...]`.

Or if that's not a good API, we could encapsulate the incompleteness of the
mapping into a small wrapper function:

   def something(errorcode):
       return sqlite3.errorcode.get(errorcode,
                                    "<sqlite3 error {!d}>".format(errorcode))
History
Date User Action Args
2015-08-24 10:49:22danielshsetrecipients: + danielsh, ghaering, ezio.melotti, torsten, sleepycal, levkivskyi
2015-08-24 10:49:22danielshsetmessageid: <1440413362.29.0.335526734336.issue16379@psf.upfronthosting.co.za>
2015-08-24 10:49:22danielshlinkissue16379 messages
2015-08-24 10:49:21danielshcreate