Defines a Rust error enum for the Tauri AppLoad plugin covering HTTP, parsing, and bundle verification failures with helper methods like is_not_found. Reuse when building Tauri plugin API clients needing structured error handling.
// Source: https://github.com/hoppscotch/hoppscotch | License: MIT | Copyright 2022
// Provided via justclaw.it.com; keep this notice with the code.
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ApiError {
#[error("HTTP request failed: {0}")]
RequestFailed(#[from] reqwest::Error),
#[error("Invalid server response: {0}")]
InvalidResponse(String),
#[error("Bundle not found: {0}")]
BundleNotFound(String),
#[error("File not found: {0}")]
FileNotFound(String),
#[error("Bundle verification failed: {0}")]
VerificationFailed(String),
#[error("API error {status}: {message}")]
ServerError { status: u16, message: String },
#[error("Failed to parse response: {0}")]
ParseError(#[from] serde_json::Error),
#[error("Server connec
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key