Anki/rslib/src/scheduler/fsrs/error.rs
Damien Elmes fff60936bc Integrate the FSRS optimizer (#2633)
* Support searching for deck configs by name

* Integrate FSRS optimizer into Anki

* Hack in a rough implementation of evaluate_weights()

* Interrupt calculation if user closes dialog

* Fix interrupted error check

* log_loss/rmse

* Update to latest fsrs commit; add progress info to weight evaluation

* Fix progress not appearing when pretrain takes a while

* Update to latest commit
2023-09-05 18:45:05 +10:00

20 lines
627 B
Rust

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use fsrs_optimizer::FSRSError;
use crate::error::AnkiError;
use crate::error::InvalidInputError;
impl From<FSRSError> for AnkiError {
fn from(err: FSRSError) -> Self {
match err {
FSRSError::NotEnoughData => InvalidInputError {
message: "Not enough data available".to_string(),
source: None,
backtrace: None,
}
.into(),
FSRSError::Interrupted => AnkiError::Interrupted,
}
}
}