catch weird error
This commit is contained in:
parent
700f0f6be4
commit
57a1062089
1 changed files with 14 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/local/bin/ruby -w
|
||||
#!/usr/bin/ruby -w
|
||||
|
||||
# $Dwarf: ripnews.rb,v 1.106 2005/05/18 21:52:51 ward Exp $
|
||||
# $Dwarf: ripnews.rb,v 1.107 2005/06/06 12:53:10 ward Exp $
|
||||
# $Source$
|
||||
|
||||
#
|
||||
|
|
@ -112,6 +112,7 @@ def save_file(dir, name, data)
|
|||
return false
|
||||
end
|
||||
when "Array"
|
||||
begin
|
||||
if file = File.new("#{dir}/#{newname}", "w", 0644)
|
||||
print " Saving as: '#{newname}'\n"
|
||||
data.collect{|i| file.print "#{i}"}
|
||||
|
|
@ -119,6 +120,12 @@ def save_file(dir, name, data)
|
|||
print "couldn't open file for writeing\n"
|
||||
return false
|
||||
end
|
||||
rescue Errno::EINVAL
|
||||
print "Caught Errno::EINVAL (save_file)\n"
|
||||
print "Error: #{$!}\n"
|
||||
print "What the *beep* happened?\n"
|
||||
return false
|
||||
end
|
||||
when "Tempfile"
|
||||
begin
|
||||
if File.move(data.path, "#{dir}/#{newname}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue