mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
jsonrpc: add invalid key to {get,set}_config error
This commit is contained in:
@@ -1674,8 +1674,11 @@ async fn set_config(
|
|||||||
if key.starts_with("ui.") {
|
if key.starts_with("ui.") {
|
||||||
ctx.set_ui_config(key, value).await?;
|
ctx.set_ui_config(key, value).await?;
|
||||||
} else {
|
} else {
|
||||||
ctx.set_config(Config::from_str(key).context("unknown key")?, value)
|
ctx.set_config(
|
||||||
.await?;
|
Config::from_str(key).with_context(|| format!("unknown key {:?}", key))?,
|
||||||
|
value,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
match key {
|
match key {
|
||||||
"sentbox_watch" | "mvbox_move" | "only_fetch_mvbox" => {
|
"sentbox_watch" | "mvbox_move" | "only_fetch_mvbox" => {
|
||||||
@@ -1694,7 +1697,7 @@ async fn get_config(
|
|||||||
if key.starts_with("ui.") {
|
if key.starts_with("ui.") {
|
||||||
ctx.get_ui_config(key).await
|
ctx.get_ui_config(key).await
|
||||||
} else {
|
} else {
|
||||||
ctx.get_config(Config::from_str(key).context("unknown key")?)
|
ctx.get_config(Config::from_str(key).with_context(|| format!("unknown key {:?}", key))?)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user