This commit is contained in:
parent
86d56734cf
commit
2b87ad09a7
3 changed files with 16 additions and 12 deletions
|
@ -48,8 +48,7 @@ impl Conductor {
|
|||
.bearer_auth(&c.api_key)
|
||||
.json(e)
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ impl Ctx {
|
|||
.bearer_auth(&self.settings.form.api_key)
|
||||
.json(payload)
|
||||
.send()
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -60,11 +59,9 @@ impl Ctx {
|
|||
.bearer_auth(&self.settings.form.api_key)
|
||||
.json(payload)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.await?
|
||||
.json()
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
|
@ -84,11 +81,9 @@ impl Ctx {
|
|||
.get(form_url)
|
||||
.bearer_auth(&self.settings.form.api_key)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.await?
|
||||
.json()
|
||||
.await
|
||||
.unwrap();
|
||||
.await?;
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@ use derive_more::{Display, Error};
|
|||
use git2::Error as GitError;
|
||||
use hmac::digest::InvalidLength;
|
||||
use hmac::digest::MacError;
|
||||
use reqwest::Error as ReqwestError;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tracing::error;
|
||||
use url::ParseError;
|
||||
|
||||
use crate::page::Page;
|
||||
|
@ -186,6 +188,14 @@ pub enum ServiceError {
|
|||
WebhookNotFound,
|
||||
}
|
||||
|
||||
impl From<ReqwestError> for ServiceError {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn from(e: ReqwestError) -> ServiceError {
|
||||
error!("{}", e);
|
||||
ServiceError::InternalServerError
|
||||
}
|
||||
}
|
||||
|
||||
impl From<InvalidLength> for ServiceError {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn from(_: InvalidLength) -> ServiceError {
|
||||
|
|
Loading…
Reference in a new issue