Skip to content

Commit 9d03fa2

Browse files
committed
Corrected inconsistent returns and raises in functions
1 parent b6a4297 commit 9d03fa2

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/murfey/client/contexts/clem.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,15 @@ def register_lif_file(
379379
logger.error(
380380
"URL could not be constructed from the environment and file path"
381381
)
382-
return ValueError
382+
return False
383383

384384
# Send the message
385385
capture_post(url)
386386
return True
387387

388-
except Exception:
388+
except Exception as e:
389389
logger.error(
390-
"Error encountered when registering the LIF file in the database"
390+
f"Error encountered when registering the LIF file in the database: {e}"
391391
)
392392
return False
393393

@@ -409,14 +409,14 @@ def process_lif_file(
409409
logger.error(
410410
"URL could not be constructed from the environment and file path"
411411
)
412-
return ValueError
412+
return False
413413

414414
# Send the message
415415
capture_post(url)
416416
return True
417417

418-
except Exception:
419-
logger.error("Error encountered processing LIF file")
418+
except Exception as e:
419+
logger.error(f"Error encountered processing LIF file: {e}")
420420
return False
421421

422422
def register_tiff_file(
@@ -435,16 +435,17 @@ def register_tiff_file(
435435
logger.error(
436436
"URL could not be constructed from the environment and file path"
437437
)
438-
return ValueError
438+
return False
439439

440440
# Send the message
441441
capture_post(url)
442442
return True
443443

444-
except Exception:
444+
except Exception as e:
445445
logger.error(
446-
"Error encountered when registering the TIFF file in the database"
446+
f"Error encountered when registering the TIFF file in the database: {e}"
447447
)
448+
return False
448449

449450
def process_tiff_series(
450451
self,
@@ -463,11 +464,12 @@ def process_tiff_series(
463464
logger.error(
464465
"URL could not be constructed from the environment and file path"
465466
)
466-
return ValueError
467+
return False
467468

468469
# Send the message
469470
capture_post(url, json=tiff_dataset)
470471
return True
471472

472-
except Exception:
473-
logger.error("Error encountered processing the TIFF series")
473+
except Exception as e:
474+
logger.error(f"Error encountered processing the TIFF series: {e}")
475+
return False

0 commit comments

Comments
 (0)