Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Error handling #24

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tungsten-sds"
version = "0.6.0"
version = "0.6.1"
description = "An MSDS parser."
authors = ["Dennis Pham <dennis@dennispham.me>", "Brian Lu <me@greencappuccino.net>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tungsten/parsers/field_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def getField(self, field: SdsQueryFieldName, target: dict):
target = command.match(target)
try:
result = post_process(target)
except (KeyError, AttributeError):
except (KeyError, AttributeError, TypeError, IndexError):
result = None
return result

Expand Down
5 changes: 4 additions & 1 deletion tungsten/parsers/supplier/sigma_aldrich/table_injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def generate_injections(self, io: IO[bytes]) -> list[Injection]:
def reject_table(table: TabulaTable) -> bool:
# TODO this is a temporary solution
# TODO reject more tables that are false positives
return table.data[1][0].text.strip()[1] == ")"
try:
return table.data[1][0].text.strip()[1] == ")"
except IndexError:
return True


@dataclass
Expand Down