Anki/qt
RumovZ c521753057
Refactor error handling (#2136)
* Add crate snafu

* Replace all inline structs in AnkiError

* Derive Snafu on AnkiError

* Use snafu for card type errors

* Use snafu whatever error for InvalidInput

* Use snafu for NotFoundError and improve message

* Use snafu for FileIoError to attach context

Remove IoError.
Add some context-attaching helpers to replace code returning bare
io::Errors.

* Add more context-attaching io helpers

* Add message, context and backtrace to new snafus

* Utilize error context and backtrace on frontend

* Rename LocalizedError -> BackendError.
* Remove DocumentedError.
* Have all backend exceptions inherit BackendError.

* Rename localized(_description) -> message

* Remove accidentally committed experimental trait

* invalid_input_context -> ok_or_invalid

* ensure_valid_input! -> require!

* Always return `Err` from `invalid_input!`

Instead of a Result to unwrap, the macro accepts a source error now.

* new_tempfile_in_parent -> new_tempfile_in_parent_of

* ok_or_not_found -> or_not_found

* ok_or_invalid -> or_invalid

* Add crate convert_case

* Use unqualified lowercase type name

* Remove uses of snafu::ensure

* Allow public construction of InvalidInputErrors (dae)

Needed to port the AnkiDroid changes.

* Make into_protobuf() public (dae)

Also required for AnkiDroid. Not sure why it worked previously - possible
bug in older Rust version?
2022-10-21 18:02:12 +10:00
..
aqt Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
bundle Update macOS bundle to Qt 6.4.0 2022-10-10 12:56:47 +10:00
icons move remaining Filter button items into sidebar 2021-02-05 18:58:22 +10:00
mac implement a basic native macOS audio recorder 2021-12-07 18:48:24 +10:00
tests Update Python deps 2022-09-24 09:46:43 +10:00
tools Introduce new color palette using Sass maps (#2016) 2022-09-16 14:11:18 +10:00
.isort.cfg initial Bazel conversion 2020-11-01 14:26:58 +10:00
.pylintrc Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
bazelfixes.py updated package scripts 2021-10-28 18:46:45 +10:00
BUILD.bazel Introduce new color palette using Sass maps (#2016) 2022-09-16 14:11:18 +10:00
dmypy.py Invoke mypy from within runfiles 2022-03-10 12:02:04 +10:00
mypy.ini Access certificates periodically 2022-08-19 10:00:38 +10:00
README.md minor doc updates 2020-12-11 22:37:12 +10:00
runanki.py get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00

Python's Qt GUI is in aqt/