add description to http errors

This commit is contained in:
Aleksandr 2025-10-16 18:26:53 +03:00
parent 955aa9dfc6
commit 18b827690f
4 changed files with 24 additions and 6 deletions

View file

@ -1,4 +1,6 @@
use eva::{logging as log, perfect_derive, component_configs::ComponentConfig, supervisor::SlaveRx};
use eva::{
component_configs::ComponentConfig, logging as log, perfect_derive, supervisor::SlaveRx,
};
use eyre::Context;
use viendesu_core::{
@ -23,14 +25,20 @@ pub trait Types: Send + Sync + 'static {
type Service: Service + Clone;
}
pub async fn serve(rx: SlaveRx, config: ComponentConfig<Config>, router: axum::Router) -> eyre::Result<()> {
pub async fn serve(
rx: SlaveRx,
config: ComponentConfig<Config>,
router: axum::Router,
) -> eyre::Result<()> {
// TODO: use it.
_ = rx;
let config::Config {
unencrypted,
ssl: _,
} = &*config;
let unencrypted = unencrypted.as_ref().expect("SSL-only currently is not supported");
let unencrypted = unencrypted
.as_ref()
.expect("SSL-only currently is not supported");
if !unencrypted.enable {
return Ok(());