From 998ed5a366c69fae5f66117672e92aa9ef82ba73 Mon Sep 17 00:00:00 2001 From: Fankai Liu Date: Mon, 20 Nov 2023 22:36:26 +0800 Subject: [PATCH] add error type --- src/template/src/app_error.hbs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/template/src/app_error.hbs b/src/template/src/app_error.hbs index 6d73705..fe3f6bc 100644 --- a/src/template/src/app_error.hbs +++ b/src/template/src/app_error.hbs @@ -52,6 +52,10 @@ pub enum AppError { #[error("mongodb::bson::oid::Error`{0}`")] MongoBsonOidError(#[from] MongoBsonOidError), {{/if}} + {{#if need_db_conn}} + #[error("ValidationError:`{0}`")] + ValidationError(#[from] validator::ValidationErrors), + {{/if}} } pub type AppResult = Result;