Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dima Gerasimov
Pod backend
Commits
fea9e224
Verified
Commit
fea9e224
authored
4 years ago
by
Vasili Novikov
Browse files
Options
Download
Email Patches
Plain Diff
Log SQL parameters for execution-time errors
parent
92334de5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/internal_api.rs
+7
-1
src/internal_api.rs
with
7 additions
and
1 deletion
+7
-1
src/internal_api.rs
+
7
-
1
View file @
fea9e224
...
...
@@ -93,7 +93,13 @@ fn execute_sql(tx: &Transaction, sql: &str, fields: &HashMap<String, Value>) ->
.map
(|(
field
,
value
)|
(
field
.as_str
(),
value
as
&
dyn
ToSql
))
.collect
();
let
mut
stmt
=
tx
.prepare_cached
(
&
sql
)
?
;
stmt
.execute_named
(
&
sql_params
)
?
;
stmt
.execute_named
(
&
sql_params
)
.map_err
(|
err
|
{
let
msg
=
format!
(
"Database rusqlite error for parameters: {:?}, {}"
,
fields
,
err
);
Error
{
code
:
StatusCode
::
BAD_REQUEST
,
msg
,
}
})
?
;
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets