lib/webdrone/xlsx.rb in webdrone-0.7.6 vs lib/webdrone/xlsx.rb in webdrone-0.8.0
- old
+ new
@@ -27,10 +27,12 @@
@dict[k] = v
end
end
end
@dict
+ rescue => exception
+ Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
def rows(sheet: nil, filename: nil)
update_sheet_filename(sheet, filename)
if @rows == nil
@@ -42,10 +44,12 @@
cell.value if cell != nil
end
end
end
@rows
+ rescue => exception
+ Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
def both(sheet: nil, filename: nil)
update_sheet_filename(sheet, filename)
if @both == nil
@@ -65,10 +69,12 @@
end
dict
end
end
@both
+ rescue => exception
+ Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
def save(sheet: nil, filename: nil, dict: nil, rows: nil)
@filename = filename if filename
@@ -108,13 +114,17 @@
end
end
end
k = workbook.write(@filename)
reset
+ rescue => exception
+ Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
def reset()
@dict = @rows = @both = nil
+ rescue => exception
+ Webdrone.report_error(@a0, exception, Kernel.caller_locations)
end
protected
def update_sheet_filename(sheet, filename)
if sheet and sheet != @sheet