Remove redundant error mapping (#1593)
Helpful regex error in Find&Replace was obscured by generic "Invalid input" error.
This commit is contained in:
parent
9936f6f7d1
commit
77b1546583
@ -7,7 +7,7 @@ use regex::Regex;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
collection::Collection,
|
collection::Collection,
|
||||||
error::{AnkiError, Result},
|
error::Result,
|
||||||
notes::{NoteId, TransformNoteOutput},
|
notes::{NoteId, TransformNoteOutput},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
text::normalize_to_nfc,
|
text::normalize_to_nfc,
|
||||||
@ -35,7 +35,7 @@ impl FindReplaceContext {
|
|||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
Ok(FindReplaceContext {
|
Ok(FindReplaceContext {
|
||||||
nids,
|
nids,
|
||||||
search: Regex::new(search_re).map_err(|_| AnkiError::invalid_input("invalid regex"))?,
|
search: Regex::new(search_re)?,
|
||||||
replacement: repl.into(),
|
replacement: repl.into(),
|
||||||
field_name,
|
field_name,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user