fixing up a few things
git-svn-id: file:///home/svn/framework3/trunk@3898 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
6a9f9ebee7
commit
902136a85e
|
@ -18,9 +18,16 @@ class RequestError < ArgumentError
|
|||
@method = method
|
||||
@result = result
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{@method}: Operation failed: #{@result}"
|
||||
end
|
||||
|
||||
# The method that failed.
|
||||
attr_reader :method
|
||||
|
||||
# The error result that occurred, typically a windows error code.
|
||||
attr_reader :result
|
||||
end
|
||||
|
||||
###
|
||||
|
|
|
@ -156,8 +156,16 @@ class Console::CommandDispatcher::Stdapi::Fs
|
|||
# Get a temporary file path
|
||||
temp_path = Tempfile.new('meterp').path
|
||||
|
||||
# Download the remote file to the temporary file
|
||||
client.fs.file.download_file(temp_path, args[0])
|
||||
begin
|
||||
# Download the remote file to the temporary file
|
||||
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
|
||||
editor = ENV['EDITOR'] || 'vi'
|
||||
|
|
Loading…
Reference in New Issue