16 lines
334 B
Rust
16 lines
334 B
Rust
use rocket::response::status::BadRequest;
|
|
use serde_json::json;
|
|
|
|
pub mod album;
|
|
pub mod artist;
|
|
pub mod track;
|
|
pub mod user;
|
|
|
|
type ApiError = BadRequest<serde_json::Value>;
|
|
type FallibleApiResponse = Result<serde_json::Value, ApiError>;
|
|
|
|
pub fn api_error(msg: &str) -> ApiError {
|
|
BadRequest(json!({
|
|
"error": msg
|
|
}))
|
|
}
|