Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
08ffba87
Unverified
Commit
08ffba87
authored
Feb 24, 2021
by
Laurent Heirendt
✈
Committed by
GitHub
Feb 24, 2021
Browse files
Merge pull request #17 from LCSB-BioCore/error-reporting
Be more verbose when reporting SBML opening errors
parents
83412adb
c9e68bc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/readsbml.jl
View file @
08ffba87
...
...
@@ -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
)
...
...
test/loadEColi.jl
View file @
08ffba87
...
...
@@ -15,7 +15,7 @@ end
@test
typeof
(
mdl
)
==
Model
@test_throws
System
Error
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test_throws
Assertion
Error
readSBML
(
sbmlfile
*
".does.not.really.exist"
)
@test
length
(
mdl
.
compartments
)
==
2
...
...
cylon-x
🤖
@cylon-x
mentioned in commit
86460503
·
Feb 24, 2021
mentioned in commit
86460503
mentioned in commit 86460503e9a65bbaa74164d8e9fb77bce4dd7a6e
Toggle commit list
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