mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-10 22:45:02 +00:00
25 lines
376 B
Rust
25 lines
376 B
Rust
|
pub extern crate serde;
|
||
|
pub extern crate thiserror;
|
||
|
|
||
|
pub mod comment;
|
||
|
pub mod community;
|
||
|
pub mod post;
|
||
|
pub mod site;
|
||
|
pub mod user;
|
||
|
|
||
|
use thiserror::Error;
|
||
|
|
||
|
#[derive(Debug, Error)]
|
||
|
#[error("{{\"error\":\"{message}\"}}")]
|
||
|
pub struct APIError {
|
||
|
pub message: String,
|
||
|
}
|
||
|
|
||
|
impl APIError {
|
||
|
pub fn err(msg: &str) -> Self {
|
||
|
APIError {
|
||
|
message: msg.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|