Better error logging
ChristopherRabotin opened this issue · comments
Chris commented
Issue
At the moment, in part because this is very early stage, ANISE does not have good or useful logging.
Here's an example where fetching data failed:
INFO lib::ephemerides::translation_verif > Query Mercury J2000 -> Venus J2000 with TimeSeries [1899-12-31T23:59:27.816030720 UTC : 2099-11-03T22:26:41.217509894 UTC : 73 days 1 h 32 min 9 s 599 ms 999 μs 714 ns]
ERROR anise::spline > [fetch] could not fetch 0-th MidPoint in spline 9133
thread 'ephemerides::translation_verif::exhaustive_de440_translation' panicked at 'called `Result::unwrap()` on an `Err` value: MalformedData(3141760)', tests/ephemerides/translation_verif.rs:325:22
stack backtrace:
0: rust_begin_unwind
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
2: core::result::unwrap_failed
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/result.rs:1814:5
3: lib::ephemerides::translation_verif::exhaustive_de440_translation
4: core::ops::function::FnOnce::call_once
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test ephemerides::translation_verif::exhaustive_de440_translation ... FAILED
failures:
failures:
ephemerides::translation_verif::exhaustive_de440_translation
This is frankly not helpful.
Test plan
- Build (or use an existing) malformed ANISE file and run any test to make sure that it returns something actually useful, including filename if possible
- Build an index of errors on the website with resolution options.
- Use a structured logged
- Find a better error handling crate which is no-std compatible.
Chris commented
Might be of relevance: https://nrc.github.io/error-docs/error-design/thinking-about-errors.html
Chris commented
This should also include updating the der crate, and being able to return these errors.
Chris commented
Greg showed me how cool snafu is in kalast, so it really sounds like we should use it here. I'll start working on it during this week.