mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	gh-129928: Rework sqlite3 error helpers (#129929)
Add a helper for raising DB-API compatible exceptions based on the result code of SQLite C APIs. Some APIs do not store the error indicator on the database pointer, so we need to be able to deduce the DB-API compatible exception directly from the error code. - rename _pysqlite_seterror() as set_error_from_db() - introduce set_error_from_code()
This commit is contained in:
		
							parent
							
								
									3a2e7aacf6
								
							
						
					
					
						commit
						3b366a4a4b
					
				
					 6 changed files with 41 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -119,7 +119,7 @@ static void
 | 
			
		|||
blob_seterror(pysqlite_Blob *self, int rc)
 | 
			
		||||
{
 | 
			
		||||
    assert(self->connection != NULL);
 | 
			
		||||
    _pysqlite_seterror(self->connection->state, self->connection->db);
 | 
			
		||||
    set_error_from_db(self->connection->state, self->connection->db);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static PyObject *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue