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$
|
# $Source$
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -112,11 +112,18 @@ def save_file(dir, name, data)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
when "Array"
|
when "Array"
|
||||||
if file = File.new("#{dir}/#{newname}", "w", 0644)
|
begin
|
||||||
print " Saving as: '#{newname}'\n"
|
if file = File.new("#{dir}/#{newname}", "w", 0644)
|
||||||
data.collect{|i| file.print "#{i}"}
|
print " Saving as: '#{newname}'\n"
|
||||||
else
|
data.collect{|i| file.print "#{i}"}
|
||||||
print "couldn't open file for writeing\n"
|
else
|
||||||
|
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
|
return false
|
||||||
end
|
end
|
||||||
when "Tempfile"
|
when "Tempfile"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue