Skip to main content

dataplane_sdk/
error.rs

1//  Copyright (c) 2026 Metaform Systems, Inc
2//
3//  This program and the accompanying materials are made available under the
4//  terms of the Apache License, Version 2.0 which is available at
5//  https://www.apache.org/licenses/LICENSE-2.0
6//
7//    SPDX-License-Identifier: Apache-2.0
8//
9//    Contributors:
10//         Metaform Systems, Inc. - initial API and implementation
11//
12
13use crate::core::{
14    error::{DbError, HandlerError},
15    model::data_flow::TransitionError,
16};
17
18pub type SdkResult<T> = Result<T, SdkError>;
19
20#[derive(Debug, thiserror::Error)]
21pub enum SdkError {
22    #[error("Handler error: {0}")]
23    Handler(#[from] HandlerError),
24    #[error("Repository error: {0}")]
25    Repo(#[from] DbError),
26    #[error("Transition error: {0}")]
27    Transition(#[from] TransitionError),
28    #[error("Notification transport error: {0}")]
29    Notification(#[from] reqwest::Error),
30    #[error("Notification rejected with status {status}: {body}")]
31    NotificationStatus { status: u16, body: String },
32}