Adds additional message when checksums mismatch during an update
This commit is contained in:
@@ -148,7 +148,7 @@ module WPScan
|
|||||||
create_backup(filename)
|
create_backup(filename)
|
||||||
dl_checksum = download(filename)
|
dl_checksum = download(filename)
|
||||||
|
|
||||||
raise "#{filename}: checksums do not match" unless dl_checksum == db_checksum
|
raise Error::ChecksumsMismatch, filename unless dl_checksum == db_checksum
|
||||||
|
|
||||||
updated << filename
|
updated << filename
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
|
|||||||
@@ -8,5 +8,17 @@ module WPScan
|
|||||||
'Update required, you can not run a scan if a database file is missing.'
|
'Update required, you can not run a scan if a database file is missing.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class ChecksumsMismatch < Standard
|
||||||
|
attr_reader :db_file
|
||||||
|
|
||||||
|
def initialize(db_file)
|
||||||
|
@db_file = db_file
|
||||||
|
end
|
||||||
|
|
||||||
|
def to_s
|
||||||
|
"#{db_file}: checksums do not match. Please try again in a few minutes."
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user