Skip to content

Commit

Permalink
Sign raise error instead of return False
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Jun 19, 2017
1 parent 2a3b8a7 commit 94c7ce9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Content/ContentManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class VerifyError(Exception):
pass


class SignError(Exception):
pass


class ContentManager(object):

def __init__(self, site):
Expand Down Expand Up @@ -587,7 +591,7 @@ def sign(self, inner_path="content.json", privatekey=None, filewrite=True, updat
privatekey_address = CryptBitcoin.privatekeyToAddress(privatekey)
valid_signers = self.getValidSigners(inner_path, new_content)
if privatekey_address not in valid_signers:
return self.log.error(
raise SignError(
"Private key invalid! Valid signers: %s, Private key address: %s" %
(valid_signers, privatekey_address)
)
Expand Down

0 comments on commit 94c7ce9

Please sign in to comment.