Verified Commit 86685832 authored by Ole Martin Ruud's avatar Ole Martin Ruud
Browse files

chore: format and fix code

parent 0df4be29
......@@ -3,7 +3,7 @@ use reqwest::Client;
use serde_json::Value as JsonValue;
use std::convert::Infallible;
use std::sync::Arc;
use tracing::{error, debug, info_span};
use tracing::{debug, error, info_span};
use tracing_futures::Instrument;
use warp::{reject, Filter, Reply};
......
......@@ -18,6 +18,7 @@ async fn main() {
}
tracing::error!("{}", msg);
// Because tracing might not be initialized (when we fail to load configuration) we also
// log propegated errors to stderr.
eprintln!("Error: {}", msg);
......@@ -26,7 +27,6 @@ async fn main() {
}
// We have a separate function for running to enable us to use ? for error handling.
async fn run() -> Result<()> {
// Parse config from environment variables
let config = config::Config::try_new().context("unable to get configuration")?;
......@@ -51,5 +51,7 @@ async fn run() -> Result<()> {
tracing::info!(addr = %addr, "started server");
Ok(server.await)
server.await;
Ok(())
}
use crate::reject::InternalServerError;
use std::borrow::Cow;
use tera::Tera;
use warp::{Rejection, Reply};
use tracing::Instrument;
use warp::{Rejection, Reply};
lazy_static::lazy_static!(
static ref TERA: Tera = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment