mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 00:19:35 +00:00
- 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
33 lines
658 B
Rust
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())
|
|
}
|
|
}
|