MortalreminderPT / edit-xlsx

A quick and easy-to-use Rust library for Excel file editing.
https://crates.io/crates/edit-xlsx
15 stars 4 forks source link

panicking "called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }" #24

Open mschnell1 opened 1 week ago

mschnell1 commented 1 week ago

when trying a more complex bigger xlsx file I get this:

@MortalreminderPT Maybe you directly see a way to improve this .....

thread 'main' panicked at C:\Users\mschnell\.cargo\registry\src\index.crates.io-6f17d22bba15001f\edit-xlsx-0.4.5\src\xml\relationships.rs:139:67:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26/library\std\src\panicking.rs:661
   1: core::panicking::panic_fmt
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26/library\core\src\panicking.rs:74
   2: core::result::unwrap_failed
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26/library\core\src\result.rs:1679
   3: enum2$<core::result::Result<u32,core::num::error::ParseIntError> >::unwrap
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\result.rs:1102
   4: edit_xlsx::xml::relationships::Relationships::get_target
             at C:\Users\mschnell\.cargo\registry\src\index.crates.io-6f17d22bba15001f\edit-xlsx-0.4.5\src\xml\relationships.rs:139
   5: edit_xlsx::api::workbook::impl$2::from_path_v2::closure$0<ref$<std::path::Path> >
             at C:\Users\mschnell\.cargo\registry\src\index.crates.io-6f17d22bba15001f\edit-xlsx-0.4.5\src\api\workbook.rs:220
   6: core::iter::adapters::map::map_fold::closure$0<ref$<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::worksheet::WorkSheet,tuple$<>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> >,core::iter::traits::iterator::Iterator:
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\iter\adapters\map.rs:89
   7: core::slice::iter::impl$182::fold<edit_xlsx::xml::workbook::Sheet,tuple$<>,core::iter::adapters::map::map_fold::closure_env$0<ref$<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::worksheet::WorkSheet,tuple$<>,edit_xlsx::api::workbook::impl$2::from_path_v2
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\slice\iter\macros.rs:232
   8: core::iter::adapters::map::impl$2::fold<edit_xlsx::api::worksheet::WorkSheet,core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> >,tuple$<>,core::iter::traits::iterato
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\iter\adapters\map.rs:129
   9: core::iter::traits::iterator::Iterator::for_each<core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> > >,alloc::vec::impl$20::extend_tru
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\iter\traits\iterator.rs:818
  10: alloc::vec::Vec<edit_xlsx::api::worksheet::WorkSheet,alloc::alloc::Global>::extend_trusted<edit_xlsx::api::worksheet::WorkSheet,alloc::alloc::Global,core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::wor
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\alloc\src\vec\mod.rs:3096
  11: alloc::vec::spec_extend::impl$1::spec_extend<edit_xlsx::api::worksheet::WorkSheet,core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> >
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\alloc\src\vec\spec_extend.rs:26
  12: alloc::vec::spec_from_iter_nested::impl$1::from_iter<edit_xlsx::api::worksheet::WorkSheet,core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\alloc\src\vec\spec_from_iter_nested.rs:62
  13: alloc::vec::spec_from_iter::impl$0::from_iter<edit_xlsx::api::worksheet::WorkSheet,core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> >
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\alloc\src\vec\spec_from_iter.rs:33
  14: alloc::vec::impl$15::from_iter<edit_xlsx::api::worksheet::WorkSheet,core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> > > >
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\alloc\src\vec\mod.rs:2970
  15: core::iter::traits::iterator::Iterator::collect<core::iter::adapters::map::Map<core::slice::iter::Iter<edit_xlsx::xml::workbook::Sheet>,edit_xlsx::api::workbook::impl$2::from_path_v2::closure_env$0<ref$<std::path::Path> > >,alloc::vec::Vec<edit_xlsx::api::
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\iter\traits\iterator.rs:2005
  16: edit_xlsx::api::workbook::Workbook::from_path_v2<ref$<std::path::Path> >
             at C:\Users\mschnell\.cargo\registry\src\index.crates.io-6f17d22bba15001f\edit-xlsx-0.4.5\src\api\workbook.rs:217
  17: edit_xlsx::api::workbook::Workbook::from_path<ref$<std::path::Path> >
             at C:\Users\mschnell\.cargo\registry\src\index.crates.io-6f17d22bba15001f\edit-xlsx-0.4.5\src\api\workbook.rs:256
  18: xlsx2adoc::converter::xlsxconvert::xlsx_convert
             at .\src\converter\xlsxconvert.rs:253
  19: xlsx2adoc::main
             at .\src\main.rs:124
  20: core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,std::io::error::Error> > (*)(),tuple$<> >
             at /rustc/bcf94dec5ba6838e435902120c0384c360126a26\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\xlsx2adoc.exe 'k:\Entpro\ASIC5486\LLT3202_CreativeChips\Creative_Chips\Messungen_Revision_C\QFN-IC2-TempMeas.xlsx' ./data/ic8.adoc` (exit code: 101)  
mschnell1 commented 1 week ago

Could we get a log and/or error propagation with such problems instead of panic ?

MortalreminderPT commented 6 days ago

Okay, I'll check it out later.