Improved error handling (part 4)
This commit is contained in:
@@ -88,7 +88,7 @@ async fn lmtp_directory() {
|
||||
Item::Verify(v) => match core.vrfy(&handle, v).await {
|
||||
Ok(v) => v.into(),
|
||||
Err(e) => {
|
||||
if e.matches(trc::StoreCause::NotSupported) {
|
||||
if e.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
|
||||
LookupResult::False
|
||||
} else {
|
||||
panic!("Unexpected error: {e:?}")
|
||||
@@ -98,7 +98,7 @@ async fn lmtp_directory() {
|
||||
Item::Expand(v) => match core.expn(&handle, v).await {
|
||||
Ok(v) => v.into(),
|
||||
Err(e) => {
|
||||
if e.matches(trc::StoreCause::NotSupported) {
|
||||
if e.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
|
||||
LookupResult::False
|
||||
} else {
|
||||
panic!("Unexpected error: {e:?}")
|
||||
@@ -132,7 +132,7 @@ async fn lmtp_directory() {
|
||||
Item::Verify(v) => match core.vrfy(&handle, v).await {
|
||||
Ok(v) => v.into(),
|
||||
Err(e) => {
|
||||
if e.matches(trc::StoreCause::NotSupported) {
|
||||
if e.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
|
||||
LookupResult::False
|
||||
} else {
|
||||
panic!("Unexpected error: {e:?}")
|
||||
@@ -142,7 +142,7 @@ async fn lmtp_directory() {
|
||||
Item::Expand(v) => match core.expn(&handle, v).await {
|
||||
Ok(v) => v.into(),
|
||||
Err(e) => {
|
||||
if e.matches(trc::StoreCause::NotSupported) {
|
||||
if e.matches(trc::Cause::Store(trc::StoreCause::NotSupported)) {
|
||||
LookupResult::False
|
||||
} else {
|
||||
panic!("Unexpected error: {e:?}")
|
||||
|
||||
@@ -689,7 +689,7 @@ pub async fn test_account_login(login: &str, secret: &str) -> Client {
|
||||
#[derive(Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum Response<T> {
|
||||
RequestError(RequestError),
|
||||
RequestError(RequestError<'static>),
|
||||
Error { error: String, details: String },
|
||||
Data { data: T },
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ pub fn spawn_mock_webhook_endpoint() -> Arc<MockWebhookEndpoint> {
|
||||
//let c = print!("rejected webhook: {}", serde_json::to_string_pretty(&request).unwrap());
|
||||
|
||||
Ok::<_, hyper::Error>(
|
||||
Err(trc::ResourceCause::NotFound.into_err())
|
||||
RequestError::not_found().into_http_response()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user