commit 5016b1a7783a7824f44aba101471803a3027972e
parent bf95602622ea0384ea758327d78ecdebe965cf5d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 5 Mar 2021 15:53:34 +0100
Log an error when the cache cannot be loaded
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/atrstm_setup_octrees.c b/src/atrstm_setup_octrees.c
@@ -683,15 +683,25 @@ error:
static res_T
load_octrees(struct atrstm* atrstm)
{
- FILE* stream;
+ FILE* stream = NULL;
+ res_T res = RES_OK;
ASSERT(atrstm && atrstm->cache && !cache_is_empty(atrstm->cache));
log_info(atrstm, "Load the acceleration data structures of the optical "
"properties from '%s'.\n", cache_get_name(atrstm->cache));
stream = cache_get_stream(atrstm->cache);
- return svx_tree_create_from_stream(atrstm->svx, stream, &atrstm->octree);
+ res = svx_tree_create_from_stream(atrstm->svx, stream, &atrstm->octree);
+ if(res != RES_OK) {
+ log_err(atrstm, "Could not load the acceleration data structures -- %s.\n",
+ res_to_cstr(res));
+ goto error;
+ }
+exit:
+ return res;
+error:
+ goto exit;
}
/*******************************************************************************