Files
dbx/crates/dbx-web/src/error.rs
T
t8y2 6e0f4e1dc3 feat: enable driver management on web version
- Extract JDBC driver/plugin logic from Tauri commands to dbx-core::jdbc
- Add web API routes for JDBC drivers, JDBC plugin, Agent JAR import, system fonts
- Upgrade zip crate from v2 to v4 in dbx-core
- Replace http.ts stubs with real HTTP calls (support File and string paths)
- Remove isWeb restrictions in DriverStoreDialog, add browser file picker support
- Fix Mac traffic light inset incorrectly applied on web version
- Show driver management toolbar button on web version
2026-05-26 01:23:26 +08:00

33 lines
658 B
Rust

use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
pub struct AppError(pub String);
impl AppError {
pub fn internal(msg: impl Into<String>) -> Self {
AppError(msg.into())
}
pub fn bad_request(msg: impl Into<String>) -> Self {
AppError(msg.into())
}
}
impl IntoResponse for AppError {
fn into_response(self) -> Response {
(StatusCode::INTERNAL_SERVER_ERROR, self.0).into_response()
}
}
impl From<String> for AppError {
fn from(s: String) -> Self {
AppError(s)
}
}
impl From<&str> for AppError {
fn from(s: &str) -> Self {
AppError(s.to_string())
}
}