-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix assert statements and deprecated logger.warn's #486
Fix assert statements and deprecated logger.warn's #486
Conversation
…he error handling/reporting Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abort should only be used for a programmer error, not an environment error. please replace with one of the standard exceptions.
@@ -76,7 +77,7 @@ def verify_store_signature(store_response, duration, verifying_key) : | |||
result = client.store_blocks([block_data], duration=default_duration) | |||
assert result | |||
|
|||
assert verify_store_signature(result, default_duration, client.verifying_key) | |||
assert (1 == verify_store_signature(result, default_duration, client.verifying_key)) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we using assert here? it pretty much blows up the entire application. can we just use the existing exceptions? the whole value of returning multiple values is to distinguish between invalid and error but you are throwing the same error both ways; as in this tells it breaks but not why
@@ -109,7 +110,7 @@ def verify_store_signature(store_response, duration, verifying_key) : | |||
result = client.store_blocks(block_data, duration=default_duration) | |||
assert result | |||
|
|||
assert verify_store_signature(result, default_duration, client.verifying_key) | |||
assert (1 == verify_store_signature(result, default_duration, client.verifying_key)) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same. this is pretty draconian.
I have changed the assert's in the file with raises's. |
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
5416289
to
e6e5088
Compare
This PR addresses #288 and #484 .