BlueBrain / nexus-forge

Building and Using Knowledge Graphs made easy
https://nexus-forge.readthedocs.io
GNU Lesser General Public License v3.0
38 stars 19 forks source link

Not use resource object when resource object creation fails in retrieve, search #300

Closed ssssarah closed 1 year ago

ssssarah commented 1 year ago

In both retrieval and search, when building the resource object, if an exception is thrown, in the catching block a reference to the "resource" variable was made when its building was unsuccessful, so a variable is referenced before assignment. This would lead to an error that would shield the real error message from the exception from being propagated.

codecov-commenter commented 1 year ago

Codecov Report

Merging #300 (ccd4597) into master (8251724) will decrease coverage by 0.39%. The diff coverage is 23.21%.

@@            Coverage Diff             @@
##           master     #300      +/-   ##
==========================================
- Coverage   73.07%   72.68%   -0.39%     
==========================================
  Files          86       86              
  Lines        5456     5499      +43     
==========================================
+ Hits         3987     3997      +10     
- Misses       1469     1502      +33     
Impacted Files Coverage Δ
kgforge/core/archetypes/store.py 61.57% <0.00%> (ø)
kgforge/core/forge.py 70.05% <0.00%> (ø)
kgforge/specializations/stores/bluebrain_nexus.py 27.36% <14.28%> (-0.35%) :arrow_down:
kgforge/specializations/resources/datasets.py 62.88% <18.18%> (-4.53%) :arrow_down:
kgforge/core/resource.py 76.19% <31.57%> (-13.21%) :arrow_down:
kgforge/core/commons/dictionaries.py 72.72% <40.00%> (-27.28%) :arrow_down:
kgforge/core/conversions/rdf.py 87.70% <50.00%> (-0.26%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.