Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print expected type instead of its string representation #194

Closed
trishankatdatadog opened this issue Dec 16, 2019 · 0 comments
Closed

Print expected type instead of its string representation #194

trishankatdatadog opened this issue Dec 16, 2019 · 0 comments

Comments

@trishankatdatadog
Copy link
Contributor

Description of issue or feature request:

Moved from the TUF repo. Also see this comment.

Current behavior:

Presently, if a user passes an object O other a list to a Schema ListOf object, the error message will print the string representation S of O. Unfortunately, the error message is obscured when the S is large (e.g. O is a set with hundreds of thousands of strings).

Expected behavior:

I think the error message would be just as effective if we simply printed the type of O.

joshuagl added a commit to joshuagl/securesystemslib that referenced this issue Jan 6, 2020
When the ListOf object's check_match() fails due to an incompatible object
having been passed, the salient information for the error message is the
type of the passed object and the type of the object against which the
check_match() method was called, therefore print those types in the error
messsage and not the string representation of the objects.

Fixes secure-systems-lab#194

Signed-off-by: Joshua Lock <[email protected]>
joshuagl added a commit to joshuagl/securesystemslib that referenced this issue Jan 6, 2020
When the ListOf object's check_match() fails due to an incompatible object
having been passed, the salient information for the error message is the
type of the passed object and the type of the object against which the
check_match() method was called, therefore print those types in the error
message and not the string representation of the objects.

Fixes secure-systems-lab#194

Signed-off-by: Joshua Lock <[email protected]>
joshuagl added a commit to joshuagl/securesystemslib that referenced this issue Jan 6, 2020
When the ListOf object's check_match() fails due to an incompatible object
having been passed, the salient information for the error message is the
type of the passed object and the type of the object against which the
check_match() method was called, therefore print those types in the error
message and not the string representation of the objects.

Fixes secure-systems-lab#194

Signed-off-by: Joshua Lock <[email protected]>
@lukpueh lukpueh closed this as completed in 81cf8fa Jan 6, 2020
tanishqjasoria pushed a commit to tanishqjasoria/securesystemslib that referenced this issue Jan 30, 2020
When the ListOf object's check_match() fails due to an incompatible object
having been passed, the salient information for the error message is the
type of the passed object and the type of the object against which the
check_match() method was called, therefore print those types in the error
message and not the string representation of the objects.

Fixes secure-systems-lab#194

Signed-off-by: Joshua Lock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant