1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-09 10:01:45 +03:00

Better error context on startup

This commit is contained in:
Quentin Gliech
2021-12-14 11:52:00 +01:00
parent 5d7619827b
commit 7341f0dccf
2 changed files with 12 additions and 5 deletions

View File

@ -215,8 +215,12 @@ impl ServerCommand {
pub async fn run(&self, root: &RootCommand) -> anyhow::Result<()> {
let config: RootConfig = root.load_config()?;
let addr: SocketAddr = config.http.address.parse()?;
let listener = TcpListener::bind(addr)?;
let addr: SocketAddr = config
.http
.address
.parse()
.context("could not parse listener address")?;
let listener = TcpListener::bind(addr).context("could not bind address")?;
// Connect to the database
let pool = config.database.connect().await?;