-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print Error on Permission Denied #27
Comments
I suspect this could be accomplished generally using the actix-web framework. If not, some "manual" logging could be added to each API method implementation. |
Indeed. What's more, the error is barely helpful in this case:
I created a tiny PR to at least print the path in this case, see #28. |
That's correct. From my understanding there would be a log with the error only when run with
It looks like Actix Web does log errors but at the Based on actix/actix-web#1557 (comment) and actix/actix-web#2637 I understand that it is by design. IMO TaskChampion Sync-Server should:
@djmitche, what are your thoughts on this? Implementation-wise, a low-hanging fruit is to add logging directly to diff --git a/src/api/mod.rs b/src/api/mod.rs
index bb5001f..e25ad6a 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -43,6 +43,7 @@ pub(crate) fn api_scope() -> Scope {
/// Convert a failure::Error to an Actix ISE
fn failure_to_ise(err: anyhow::Error) -> impl actix_web::ResponseError {
+ log::error!("{err:?}");
error::InternalError::new(err, StatusCode::INTERNAL_SERVER_ERROR)
} but that depends on various places to use this specific function. And it only deals with internal server errors. Alternatively, an Actix middleware could be implemented. It could log when it observes that a response is in fact an error. I think it could also log at different levels based on the specific error. |
Taskwarrior gave me some "Failed to synchronize with server" while trying to sync. Turns out it failed because the server had no permission to write in the default data directory.
The server itself did not show any error unfortunately. The only time it does print an error is when you run it the first time and it cannot initialize the data directory. Running it once with sudo creates the directory / files, but if you run it again without sudo, and syncing fails due to lack of permissions, the server keeps quiet.
Thought it would be helpful to print an error or have some server logs.
The text was updated successfully, but these errors were encountered: