Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy viewer fails to display a JSON file #161

Open
moshelior opened this issue Mar 28, 2023 · 2 comments
Open

Tidy viewer fails to display a JSON file #161

moshelior opened this issue Mar 28, 2023 · 2 comments
Labels
good first issue Good for newcomers

Comments

@moshelior
Copy link

moshelior commented Mar 28, 2023

$ tidy-viewer --version
tv 1.4.30
$ export RUST_BACKTRACE=full                                                                                                                                                                   
$ tidy-viewer curl_init.json
thread 'main' panicked at 'a csv record: Error(UnequalLengths { pos: Some(Position { byte: 6, line: 3, record: 2 }), expected_len: 1, len: 2 })', /home/moshe/.cargo/registry/src/github.com-1ecc6299db9ec823/tidy-viewer-1.4.30/src/main.rs:388:20
stack backtrace:
   0:     0x55b4a0fd248a - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55b4a0fd248a - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55b4a0fd248a - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55b4a0fd248a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55b4a0ff55de - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:     0x55b4a0fcf2d5 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:     0x55b4a0fd2255 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55b4a0fd2255 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55b4a0fd38df - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:     0x55b4a0fd361b - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:     0x55b4a0fd3fec - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
  11:     0x55b4a0fd3d89 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:579:13
  12:     0x55b4a0fd293c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x55b4a0fd3a92 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  14:     0x55b4a0eafe63 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  15:     0x55b4a0eb02f3 - core::result::unwrap_failed::h4d34d8346233eb49
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/result.rs:1791:5
  16:     0x55b4a0ecdeba - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::ha4b5f41eed5570e1
  17:     0x55b4a0ed2401 - tidy_viewer::main::h89e56482d8be0301
  18:     0x55b4a0ec6763 - std::sys_common::backtrace::__rust_begin_short_backtrace::hf4656e6c5ad86af8
  19:     0x55b4a0edbb49 - std::rt::lang_start::{{closure}}::h5c8e9915b9f08176
  20:     0x55b4a0fc9cec - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9ab31282e87f134a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
  21:     0x55b4a0fc9cec - std::panicking::try::do_call::h42ddf5b01d0b4bc7
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  22:     0x55b4a0fc9cec - std::panicking::try::hfb70320d7386c61a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  23:     0x55b4a0fc9cec - std::panic::catch_unwind::h978c9edbad2bb4d4
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  24:     0x55b4a0fc9cec - std::rt::lang_start_internal::{{closure}}::h04ede5bd2f26b553
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
  25:     0x55b4a0fc9cec - std::panicking::try::do_call::ha6b9da35a0885c93
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  26:     0x55b4a0fc9cec - std::panicking::try::h3325520cab3a642e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  27:     0x55b4a0fc9cec - std::panic::catch_unwind::h160beec6f047175b
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  28:     0x55b4a0fc9cec - std::rt::lang_start_internal::h79190e3a877a769d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  29:     0x55b4a0ed7685 - main
  30:     0x7f77d5e13083 - __libc_start_main
                               at /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
  31:     0x55b4a0eb048e - _start
  32:                0x0 - <unknown>

I cannot provide the JSON file since it's (work) confidential.

@alexhallam
Copy link
Owner

Thanks for the issue. tv will not support json. The strength of json is its flexibility. The weakness of json is its flexibility. Valid data can take many different forms in json format.

What I would do is use a tool like jq to convert your instance of data into a csv then you can pipe the csv data to tv.

https://stedolan.github.io/jq/

@alexhallam
Copy link
Owner

Maybe there is a way to fail with more grace though.

@alexhallam alexhallam added the good first issue Good for newcomers label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants