api/config: use param_bail for parameter errors

when using the 'extjs' formatter, it marks them in a way, so that
the gui can mark the form fields with the error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dominik Csapak
2022-03-04 14:47:50 +01:00
committed by Wolfgang Bumiller
parent 4042eedf18
commit 8d6425aa24
12 changed files with 36 additions and 36 deletions

View File

@ -6,7 +6,7 @@ use ::serde::{Deserialize, Serialize};
use hex::FromHex;
use proxmox_router::{Router, RpcEnvironment, Permission};
use proxmox_schema::api;
use proxmox_schema::{api, param_bail};
use pbs_api_types::{
OpenIdRealmConfig, OpenIdRealmConfigUpdater,
@ -68,7 +68,7 @@ pub fn create_openid_realm(config: OpenIdRealmConfig) -> Result<(), Error> {
config.realm == "pam" ||
domains.sections.get(&config.realm).is_some()
{
bail!("realm '{}' already exists.", config.realm);
param_bail!("realm", "realm '{}' already exists.", config.realm);
}
domains.set_data(&config.realm, "openid", &config)?;