Catch ENOENT for db_destroy for sqlite3 so no backtrace is printed. I decided

to give a little error message for trying to destroy a nonexistent db still.


git-svn-id: file:///home/svn/framework3/trunk@6468 4d416f70-5f16-0410-b530-b9f4589650da
unstable
kris 2009-04-08 03:30:18 +00:00
parent b5a8c86241
commit 1253e7a044
1 changed files with 6 additions and 2 deletions

View File

@ -780,9 +780,13 @@ class Db
def db_destroy_sqlite3(*args)
cmd_db_disconnect()
info = db_parse_db_uri_sqlite3(args[0])
File.unlink(info[:path])
begin
File.unlink(info[:path])
rescue Errno::ENOENT
print_error("The specified database does not exist")
end
end
def db_parse_db_uri_sqlite3(path)
res = {}
res[:path] = path || ::File.join(Msf::Config.config_directory, 'sqlite3.db')