diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 21:21:26 -0700 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 21:21:26 -0700 |
commit | 2d129fffd7278ce292dbb76d7b7ad493811ee22d (patch) | |
tree | a881d4905ae5818a3971d8999374d8e53d8130cf /engine.rb | |
parent | 8d2eae318e541965f031a1acaf88f14234cc2fe8 (diff) |
Handle invalid checksums
Diffstat (limited to 'engine.rb')
-rw-r--r-- | engine.rb | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,3 +1,6 @@ +class InvalidChecksumError < StandardError +end + class Engine def initialize hash validate_checksum hash @@ -6,7 +9,7 @@ class Engine def validate_checksum hash if !checksum_valid? hash - throw 'Invalid state, checksum does not match!' + raise InvalidChecksumError end end |