From 9b0a55b87360ace4eae8af24dbe7846ff43ae4e6 Mon Sep 17 00:00:00 2001 From: Alan Pinkert Date: Tue, 7 May 2024 10:33:25 -0400 Subject: [PATCH] enhanced validation message --- ocsf_validator/errors.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ocsf_validator/errors.py b/ocsf_validator/errors.py index 99fc7f4..95c0cfe 100644 --- a/ocsf_validator/errors.py +++ b/ocsf_validator/errors.py @@ -85,13 +85,8 @@ def __init__( else: trail_str = ".".join(trail) - if cls is None: - cls_str = "" - else: - cls_str = cls.__name__ + "." - super().__init__( - f"Missing required key `{cls_str}{key}` at `{trail_str}` in {file}" + f"Missing required key `{key}` at `{trail_str}` in {file}. Make sure required fields in this file and any supporting files such as dictionaries or includes are populated." ) @@ -113,13 +108,8 @@ def __init__( else: trail_str = ".".join(trail) - if cls is None: - cls_str = "" - else: - cls_str = cls.__name__ - super().__init__( - f"Unrecognized key `{key}` of `{cls_str}` at `{trail_str}` in {file}" + f"Unrecognized key `{key}` at `{trail_str}` in {file}. Make sure fields in this file and any supporting files such as dictionaries or includes are valid." )