report object type where json decode fails
This commit is contained in:
parent
d3062ceda4
commit
47284867f9
@ -361,7 +361,9 @@ impl SqliteStorage {
|
||||
|
||||
pub(crate) fn upgrade_decks_to_schema15(&self, server: bool) -> Result<()> {
|
||||
let usn = self.usn(server)?;
|
||||
let decks = self.get_schema11_decks()?;
|
||||
let decks = self
|
||||
.get_schema11_decks()
|
||||
.map_err(|e| AnkiError::JsonError(format!("decoding decks: {}", e)))?;
|
||||
let mut names = HashSet::new();
|
||||
for (_id, deck) in decks {
|
||||
let oldname = deck.name().to_string();
|
||||
|
@ -160,7 +160,7 @@ impl SqliteStorage {
|
||||
let conf: Value = serde_json::from_str(text)?;
|
||||
serde_json::from_value(conf)
|
||||
})
|
||||
.map_err(Into::into)
|
||||
.map_err(|e| AnkiError::JsonError(format!("decoding deck config: {}", e)))
|
||||
})?;
|
||||
for (id, mut conf) in conf.into_iter() {
|
||||
// buggy clients may have failed to set inner id to match hash key
|
||||
|
@ -302,7 +302,9 @@ impl SqliteStorage {
|
||||
}
|
||||
|
||||
pub(crate) fn upgrade_notetypes_to_schema15(&self) -> Result<()> {
|
||||
let nts = self.get_schema11_notetypes()?;
|
||||
let nts = self
|
||||
.get_schema11_notetypes()
|
||||
.map_err(|e| AnkiError::JsonError(format!("decoding models: {}", e)))?;
|
||||
let mut names = HashSet::new();
|
||||
for (mut ntid, nt) in nts {
|
||||
let mut nt = Notetype::from(nt);
|
||||
|
Loading…
Reference in New Issue
Block a user