mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
db.pg: add support for -d trace_pg_error
This commit is contained in:
parent
3b2e58eace
commit
8275dc5a73
@ -279,6 +279,9 @@ fn (db DB) handle_error_or_result(res voidptr, elabel string) ![]Row {
|
||||
e := unsafe { C.PQerrorMessage(db.conn).vstring() }
|
||||
if e != '' {
|
||||
C.PQclear(res)
|
||||
$if trace_pg_error ? {
|
||||
eprintln('pg error: ${e}')
|
||||
}
|
||||
return error('pg ${elabel} error:\n${e}')
|
||||
}
|
||||
return res_to_rows(res)
|
||||
|
Loading…
Reference in New Issue
Block a user