more print error

This commit is contained in:
Christoph J. Scherr 2024-04-26 14:24:23 +02:00
parent e7ab89f050
commit 411ded1395
1 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,5 @@
use std::error::Error as _;
use autocrate::{ use autocrate::{
changelog::*, changelog::*,
config::{ config::{
@ -9,7 +11,7 @@ use autocrate::{
release::release, release::release,
serverapi::ApiCollection, serverapi::ApiCollection,
}; };
use libpt::log::error; use libpt::log::{debug, error};
#[tokio::main] #[tokio::main]
async fn main() -> Result<()> { async fn main() -> Result<()> {
@ -31,14 +33,14 @@ async fn main() -> Result<()> {
let mut apis = ApiCollection::build(&cfg).await?; let mut apis = ApiCollection::build(&cfg).await?;
match release(&cfg, &mut apis).await { match release(&cfg, &mut apis).await {
Ok(_) => None, Ok(_) => None,
Err(err) => Some(err) Err(err) => Some(err),
} }
} }
Commands::Publish { .. } => { Commands::Publish { .. } => {
// TODO: check if repo is dirty and create a commit with a given option // TODO: check if repo is dirty and create a commit with a given option
match publish(&cfg).await { match publish(&cfg).await {
Ok(_) => None, Ok(_) => None,
Err(err) => Some(err) Err(err) => Some(err),
} }
} }
Commands::Version {} => { Commands::Version {} => {
@ -54,6 +56,7 @@ async fn main() -> Result<()> {
}; };
if let Some(err) = status { if let Some(err) = status {
error!("{err}"); error!("{err}");
debug!("{:#?}", err.source());
} }
Ok(()) Ok(())
} }