-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rendering return Result, and handle infinite recursion
- Loading branch information
Showing
25 changed files
with
346 additions
and
333 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use serde::{Serialize, Serializer}; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
#[error("Render error: {0}")] | ||
TemplateError(#[from] yaak_templates::error::Error), | ||
|
||
#[error("Model error: {0}")] | ||
ModelError(#[from] yaak_models::error::Error), | ||
|
||
#[error("Sync error: {0}")] | ||
SyncError(#[from] yaak_sync::error::Error), | ||
|
||
#[error("Git error: {0}")] | ||
GitError(#[from] yaak_git::error::Error), | ||
|
||
#[error("Websocket error: {0}")] | ||
WebsocketError(#[from] yaak_ws::error::Error), | ||
|
||
#[error("License error: {0}")] | ||
LicenseError(#[from] yaak_license::error::Error), | ||
|
||
#[error("Plugin error: {0}")] | ||
PluginError(#[from] yaak_plugins::error::Error), | ||
|
||
#[error("Request error: {0}")] | ||
RequestError(#[from] reqwest::Error), | ||
|
||
#[error("Generic error: {0}")] | ||
GenericError(String), | ||
} | ||
|
||
impl Serialize for Error { | ||
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> | ||
where | ||
S: Serializer, | ||
{ | ||
serializer.serialize_str(self.to_string().as_ref()) | ||
} | ||
} | ||
|
||
pub type Result<T> = std::result::Result<T, Error>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.