Anki is a smart spaced repetition flashcard program
Find a file
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
.buildkite Make build step optional in Linux docker containers 2022-03-09 18:20:13 +10:00
.github/ISSUE_TEMPLATE update bug report template 2021-11-12 12:20:02 +10:00
.vscode.dist Move VS Code settings to .vscode.dist and update docs (#2029) 2022-08-24 16:08:58 +10:00
cargo Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
docs Document Protocol Buffers used in Anki (#2042) 2022-09-01 22:01:14 +10:00
ftl Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
platforms use x86 binaries for clang format/protobuf on Mac 2021-10-16 18:07:39 +10:00
proto Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
pylib Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
python Update to Qt 6.4.0 2022-10-10 12:29:02 +10:00
qt Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
rslib Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
sass Add stylesheet for QMenu (#2122) 2022-10-12 14:29:06 +10:00
tools Update macOS bundle to Qt 6.4.0 2022-10-10 12:56:47 +10:00
ts Make resizer snap to closest end and improve toggle (#2129) 2022-10-13 10:13:19 +10:00
.bazelignore updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
.bazelrc Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
.bazelversion Bump bazel version 2022-04-20 21:53:59 +10:00
.gitattributes try again to improve GitHub's language stats 2021-01-20 13:20:45 +10:00
.gitignore Move VS Code settings to .vscode.dist and update docs (#2029) 2022-08-24 16:08:58 +10:00
.prettierignore Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
.prettierrc Mathjax editor improvements (#1502) 2021-11-23 10:27:32 +10:00
.user.bazelrc move Bazel convenience symlinks outside of repo folder 2022-01-23 19:18:44 +10:00
BUILD.bazel updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
Cargo.lock Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
Cargo.toml Refactor error handling (#2136) 2022-10-21 18:02:12 +10:00
CONTRIBUTORS Fix Windows dark mode detection: OpenKey can fail (#2068) 2022-09-15 12:04:19 +10:00
defs.bzl Update to latest rules_rust and Rust 1.64 2022-09-24 11:12:58 +10:00
late_deps.bzl Update to latest rules_rust and Rust 1.64 2022-09-24 11:12:58 +10:00
LICENSE move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
package.json Fuzzy search in symbol insertion overlay (#2059) 2022-09-13 14:19:19 +10:00
pkgkey.asc add public key for release signing 2018-09-18 10:40:45 +10:00
pyrightconfig.json updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
README.md fix build badge 2021-06-24 09:21:56 +10:00
repos.bzl Update translations 2022-10-12 14:48:26 +10:00
run get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00
run.bat updates to the build process and binary bundles 2022-02-10 19:23:07 +10:00
SECURITY.md add SECURITY.md 2021-09-22 22:55:19 +10:00
WORKSPACE move node_modules into root folder [action required] 2021-10-07 11:42:27 +10:00
yarn.lock Update d3 deps for CWE 2022-09-30 14:22:23 +10:00

Anki

Build status

This repo contains the source code for the computer version of Anki.

If you'd like to try development builds of Anki but don't feel comfortable building the code, please see https://betas.ankiweb.net/

For more information on building, please see Development.