You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Error messages could be improved, related issue: #115
Describe the solution you'd like
The actual variable should be part of the error message, where it makes sense.
e.g. instead of raise TypeError("'name' (string) should be from 1-30 chars.")
it could be raise TypeError(f"'name' (string) [{name}] should be from 1-30 chars.") - so the actual name can be seen.
Same goes for other checks, e.g.
TypeError("'field_type' (string) must be in [" + ", ".join(_type2rfc) + "]") -> TypeError(f"'field_type' (string) [{field_type}] must be in [" + ", ".join(_type2rfc) + "]")
TypeError("'direction' (string) must be in [" + ", ".join(_direction2rfc) + "]") -> TypeError(f"'direction' (string) [{direction}] must be in [" + ", ".join(_direction2rfc) + "]")
and so on.
Variables do not neccessarily have to be in square brackets, but I've seen it in print (f"[{datetime.utcnow()} UTC] {origin} '{log_message}'") - plus it helps to figure out if there are leading/trailing spaces in a variable.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Error messages could be improved, related issue: #115
Describe the solution you'd like
The actual variable should be part of the error message, where it makes sense.
e.g. instead of
raise TypeError("'name' (string) should be from 1-30 chars.")
it could be
raise TypeError(f"'name' (string) [{name}] should be from 1-30 chars.")
- so the actual name can be seen.Same goes for other checks, e.g.
TypeError("'field_type' (string) must be in [" + ", ".join(_type2rfc) + "]")
->TypeError(f"'field_type' (string) [{field_type}] must be in [" + ", ".join(_type2rfc) + "]")
TypeError("'direction' (string) must be in [" + ", ".join(_direction2rfc) + "]")
->TypeError(f"'direction' (string) [{direction}] must be in [" + ", ".join(_direction2rfc) + "]")
and so on.
Variables do not neccessarily have to be in square brackets, but I've seen it in
print (f"[{datetime.utcnow()} UTC] {origin} '{log_message}'")
- plus it helps to figure out if there are leading/trailing spaces in a variable.The text was updated successfully, but these errors were encountered: