Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
2ae712af
Commit
2ae712af
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Improved message of exception thrown by SqliteRset::columnOptionalString()
parent
fd61af47
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdbms/SqliteRset.cpp
+8
-4
8 additions, 4 deletions
rdbms/SqliteRset.cpp
with
8 additions
and
4 deletions
rdbms/SqliteRset.cpp
+
8
−
4
View file @
2ae712af
...
...
@@ -219,10 +219,14 @@ optional<std::string> SqliteRset::columnOptionalString(const std::string &colNam
if
(
SQLITE_NULL
==
idxAndType
.
colType
)
{
return
nullopt
;
}
else
{
const
unsigned
char
*
column_text
=
sqlite3_column_text
(
m_stmt
.
get
(),
idxAndType
.
colIdx
);
cta
::
exception
::
Errnum
::
throwOnNull
(
column_text
,
std
::
string
(
"In SqliteRset::columnOptionalString(): got NULL column text for "
)
+
colName
);
return
optional
<
std
::
string
>
((
const
char
*
)
column_text
);
const
char
*
const
colValue
=
(
const
char
*
)
sqlite3_column_text
(
m_stmt
.
get
(),
idxAndType
.
colIdx
);
if
(
NULL
==
colValue
)
{
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
__FUNCTION__
<<
" failed: sqlite3_column_text() returned NULL when"
" m_colNameToIdxAndType map states otherwise: colName="
<<
colName
<<
",colIdx="
<<
idxAndType
.
colIdx
;
throw
ex
;
}
return
optional
<
std
::
string
>
(
colValue
);
}
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed: "
+
ex
.
getMessage
().
str
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment