mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-12 08:42:37 +02:00
fix: resolve publisher resource leak and field parse validation (#886)
This commit is contained in:
parent
80a7579639
commit
c2f1759bdf
1 changed files with 3 additions and 3 deletions
|
|
@ -29,8 +29,8 @@ class Field:
|
|||
|
||||
parts = defn.split(":")
|
||||
|
||||
if len(parts) == 0:
|
||||
raise RuntimeError("Field definition cannot be empty")
|
||||
if len(parts) > 5:
|
||||
raise RuntimeError("Too many fields in definition")
|
||||
|
||||
if len(parts) == 1: parts.append("string")
|
||||
if len(parts) == 2: parts.append("0")
|
||||
|
|
@ -43,7 +43,7 @@ class Field:
|
|||
|
||||
try:
|
||||
type = FieldType[type.upper()]
|
||||
except:
|
||||
except KeyError:
|
||||
raise RuntimeError(f"Field type {type} is not known")
|
||||
|
||||
pri = True if pri == "pri" else False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue