Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
d3acb0c3
Commit
d3acb0c3
authored
Aug 12, 2016
by
Hugo Beauzée-Luyssen
Browse files
sqlite: Statement: minor simplification
parent
27c5bab2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/database/SqliteTools.h
View file @
d3acb0c3
...
...
@@ -149,17 +149,14 @@ public:
return
Row
(
m_stmt
.
get
()
);
else
if
(
res
==
SQLITE_DONE
)
return
Row
();
else
std
::
string
errMsg
=
sqlite3_errmsg
(
m_dbConn
);
switch
(
res
)
{
std
::
string
errMsg
=
sqlite3_errmsg
(
m_dbConn
);
switch
(
res
)
{
case
SQLITE_CONSTRAINT
:
throw
errors
::
ConstraintViolation
(
sqlite3_sql
(
m_stmt
.
get
()
),
errMsg
);
default:
throw
std
::
runtime_error
(
std
::
string
{
sqlite3_sql
(
m_stmt
.
get
()
)
}
+
": "
+
errMsg
);
}
case
SQLITE_CONSTRAINT
:
throw
errors
::
ConstraintViolation
(
sqlite3_sql
(
m_stmt
.
get
()
),
errMsg
);
default:
throw
std
::
runtime_error
(
std
::
string
{
sqlite3_sql
(
m_stmt
.
get
()
)
}
+
": "
+
errMsg
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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