Display validation errors
This commit is contained in:
parent
0a85d78a9b
commit
eb35037bca
@ -19,7 +19,7 @@ name = "actix_admin"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[features]
|
||||
default = ["bulma_css"]
|
||||
default = ["bulma_css", 'enable-tracing']
|
||||
bulma_css = []
|
||||
enable-tracing = ['tracing']
|
||||
|
||||
|
@ -118,7 +118,7 @@ pub enum ActixAdminError {
|
||||
impl error::ResponseError for ActixAdminError {
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
#[cfg(feature="enable-tracing")]
|
||||
tracing::debug!("{self}");
|
||||
tracing::debug!("{self:#?}");
|
||||
HttpResponse::build(self.status_code())
|
||||
.insert_header(ContentType::html())
|
||||
.body(self.to_string())
|
||||
|
@ -86,6 +86,11 @@ pub async fn create_or_edit_post<E: ActixAdminViewModelTrait>(
|
||||
|
||||
if model.has_errors() {
|
||||
errors.push(ActixAdminError::ValidationErrors);
|
||||
#[cfg(feature="enable-tracing")]
|
||||
{
|
||||
tracing::error!("OP errors: {errors:#?}");
|
||||
tracing::debug!("Model errors: {:#?}", model.errors);
|
||||
}
|
||||
render_form::<E>(
|
||||
req,
|
||||
actix_admin,
|
||||
|
Loading…
Reference in New Issue
Block a user