xlsxir icon indicating copy to clipboard operation
xlsxir copied to clipboard

Unable to catch/rescue exception from Xlsxir.stream_list

Open benschenker opened this issue 6 years ago • 1 comments

I have an excel file with some bad data that crashes Xlsxir.stream_list in an uncatchable way. Example: run mix test on https://github.com/benschenker/brokelixir

It fails with:

10:20:17.303 [error] Process #PID<0.195.0> raised an exception
** (RuntimeError) Unknown cell attribute
    (xlsxir) lib/xlsxir/parse_worksheet.ex:73: anonymous fn/2 in Xlsxir.ParseWorksheet.sax_event_handler/4
    (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
    (xlsxir) lib/xlsxir/parse_worksheet.ex:68: Xlsxir.ParseWorksheet.sax_event_handler/4
    (erlsom) 

even though the call is wrapped in a try/rescue block, I have also tried catching :exit to no avail.

I'd love to put up a pr to fix this but after poking around a bit it feels like I may need a bit of guidance. Any assistance is appreciated.

benschenker avatar Feb 25 '19 15:02 benschenker

I ran into this too, and it's a problem that Xlsir is spawning an unmonitored process that can throw exceptions like this, which never recover since it's not linked. That needs to be fixed.

In the meantime, I have removed that exception from occurring in #98 so at least it avoids the exception.

dbernheisel avatar Mar 06 '20 15:03 dbernheisel