Skip to content

Commit

Permalink
Switch info with error logging statements in exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
SylviaWhittle committed Apr 29, 2024
1 parent 4f5b611 commit d90db6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions topofileformats/spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def load_spm(file_path: Path | str, channel: str) -> tuple:
logger.info(f"[{filename}] : Extracted channel {channel}")
image = np.flipud(np.array(channel_data.pixels))
except FileNotFoundError:
logger.info(f"[{filename}] File not found : {file_path}")
logger.error(f"[{filename}] File not found : {file_path}")
raise
except Exception as e:
if "Channel" in str(e) and "not found" in str(e):
Expand All @@ -69,7 +69,7 @@ def load_spm(file_path: Path | str, channel: str) -> tuple:
channel_name = channel_option.decode("latin1").split(" ")[1][1:-1]
# channel_description = channel.decode('latin1').split('"')[1] # incase the blank field raises quesions?
labels.append(channel_name)
logger.info(f"[{filename}] : {channel} not in {file_path.suffix} channel list: {labels}")
logger.error(f"[{filename}] : {channel} not in {file_path.suffix} channel list: {labels}")
raise ValueError(f"{channel} not in {file_path.suffix} channel list: {labels}") from e
raise e

Expand Down

0 comments on commit d90db6d

Please sign in to comment.