Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
49912d01
Unverified
Commit
49912d01
authored
Nov 03, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error reporting
parent
d4758e09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
20 deletions
+4
-20
src/compound.cpp
+2
-18
src/text.cpp
+2
-2
No files found.
src/compound.cpp
View file @
49912d01
...
...
@@ -689,9 +689,7 @@ void compound_factory::set_default_dictionary(const fs::path &inDictFile)
}
catch
(
const
std
::
exception
&
)
{
if
(
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Error loading dictionary "
<<
inDictFile
<<
std
::
endl
;
throw
;
std
::
throw_with_nested
(
std
::
runtime_error
(
"Error loading dictionary "
+
inDictFile
.
string
()));
}
}
...
...
@@ -700,19 +698,13 @@ void compound_factory::push_dictionary(const fs::path &inDictFile)
if
(
not
fs
::
exists
(
inDictFile
))
throw
std
::
runtime_error
(
"file not found: "
+
inDictFile
.
string
());
// ifstream file(inDictFile);
// if (not file.is_open())
// throw std::runtime_error("Could not open peptide list " + inDictFile);
try
{
m_impl
.
reset
(
new
compound_factory_impl
(
inDictFile
,
m_impl
));
}
catch
(
const
std
::
exception
&
)
{
if
(
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Error loading dictionary "
<<
inDictFile
<<
std
::
endl
;
throw
;
std
::
throw_with_nested
(
std
::
runtime_error
(
"Error loading dictionary "
+
inDictFile
.
string
()));
}
}
...
...
@@ -724,14 +716,6 @@ void compound_factory::pop_dictionary()
const
compound
*
compound_factory
::
create
(
std
::
string
id
)
{
// static bool warned = false;
// if (m_impl and warned == false)
// {
// std::cerr << "Warning: no compound information library was found, resulting data may be incorrect or incomplete" << std::endl;
// warned = true;
// }
return
m_impl
?
m_impl
->
get
(
id
)
:
nullptr
;
}
...
...
src/text.cpp
View file @
49912d01
...
...
@@ -220,11 +220,11 @@ std::tuple<std::string, std::string> split_tag_name(std::string_view tag)
if
(
tag
.
empty
())
throw
std
::
runtime_error
(
"empty tag"
);
if
(
tag
[
0
]
!=
'_'
)
throw
std
::
runtime_error
(
"tag does not start with underscore"
);
throw
std
::
runtime_error
(
"tag
'"
+
std
::
string
{
tag
}
+
"'
does not start with underscore"
);
auto
s
=
tag
.
find
(
'.'
);
if
(
s
==
std
::
string
::
npos
)
throw
std
::
runtime_error
(
"tag does not contain dot
"
);
throw
std
::
runtime_error
(
"tag does not contain dot
("
+
std
::
string
{
tag
}
+
')'
);
return
std
::
tuple
<
std
::
string
,
std
::
string
>
{
tag
.
substr
(
1
,
s
-
1
),
tag
.
substr
(
s
+
1
)};
}
...
...
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