Expands SDK support to 8 additional languages/frameworks: - Java SDK with Maven/OkHttp/Jackson - Kotlin SDK with Gradle/Ktor/kotlinx.serialization - Swift SDK with Swift Package Manager/async-await - C SDK with CMake/libcurl - C++ SDK with CMake/Modern C++20 - C# SDK with .NET 8.0/HttpClient - Ruby SDK with Bundler/Faraday - Rust SDK with Cargo/reqwest/tokio All SDKs include: - Tensor operations (matmul, conv2d, attention) - LLM inference with streaming support - Model registry, pricing, and usage APIs - Builder patterns where idiomatic - Full type safety
33 lines
756 B
Rust
33 lines
756 B
Rust
//! Error types for the Synor Compute SDK.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// SDK error type.
|
|
#[derive(Error, Debug)]
|
|
pub enum Error {
|
|
/// HTTP request failed.
|
|
#[error("HTTP error: {0}")]
|
|
Http(#[from] reqwest::Error),
|
|
|
|
/// JSON parsing failed.
|
|
#[error("JSON error: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
|
|
/// API returned an error.
|
|
#[error("API error ({status_code}): {message}")]
|
|
Api {
|
|
status_code: u16,
|
|
message: String,
|
|
},
|
|
|
|
/// Invalid argument.
|
|
#[error("Invalid argument: {0}")]
|
|
InvalidArgument(String),
|
|
|
|
/// Client has been closed.
|
|
#[error("Client has been closed")]
|
|
ClientClosed,
|
|
}
|
|
|
|
/// Result type alias for SDK operations.
|
|
pub type Result<T> = std::result::Result<T, Error>;
|