don't raise exception if file download fails
parent
284ef5bbbb
commit
64c2bf3227
|
@ -324,16 +324,8 @@ class Console::CommandDispatcher::Stdapi::Fs
|
||||||
meterp_temp.binmode
|
meterp_temp.binmode
|
||||||
temp_path = meterp_temp.path
|
temp_path = meterp_temp.path
|
||||||
|
|
||||||
begin
|
# Try to download the file, but don't worry if it doesn't exist
|
||||||
# Download the remote file to the temporary file
|
client.fs.file.download_file(temp_path, args[0]) rescue nil
|
||||||
client.fs.file.download_file(temp_path, args[0])
|
|
||||||
rescue RequestError => re
|
|
||||||
# If the file doesn't exist, then it's okay. Otherwise, throw the
|
|
||||||
# error.
|
|
||||||
if re.result != 2
|
|
||||||
raise $!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Spawn the editor (default to vi)
|
# Spawn the editor (default to vi)
|
||||||
editor = Rex::Compat.getenv('EDITOR') || 'vi'
|
editor = Rex::Compat.getenv('EDITOR') || 'vi'
|
||||||
|
|
Loading…
Reference in New Issue