Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Gitlab will go into maintenance Friday 3rd February from 9:00 to 10:00
Open sidebar
LCSB-BioCore
SBML.jl
Commits
8be4d18c
Commit
8be4d18c
authored
Feb 23, 2021
by
Miroslav Kratochvil
🚴
Browse files
Be more verbose when reporting SBML opening errors
parent
83412adb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/readsbml.jl
View file @
8be4d18c
...
...
@@ -10,8 +10,13 @@ function readSBML(fn::String)::Model
doc
=
ccall
(
sbml
(
:
readSBML
),
VPtr
,
(
Cstring
,),
fn
)
try
n_errs
=
ccall
(
sbml
(
:
SBMLDocument_getNumErrors
),
Cuint
,
(
VPtr
,),
doc
)
for
i
=
0
:
n_errs
-
1
err
=
ccall
(
sbml
(
:
SBMLDocument_getError
),
VPtr
,
(
VPtr
,
Cuint
),
doc
,
i
)
msg
=
unsafe_string
(
ccall
(
sbml
(
:
XMLError_getMessage
),
Cstring
,
(
VPtr
,),
err
))
@warn
"SBML reported error:
$
msg"
end
if
n_errs
>
0
throw
(
System
Error
(
"Opening SBML document has
failed
"
))
throw
(
Assertion
Error
(
"Opening SBML document has
reported errors
"
))
end
if
0
==
ccall
(
sbml
(
:
SBMLDocument_isSetModel
),
Cint
,
(
VPtr
,),
doc
)
...
...
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