error logging in native open

feat/vaults
Tomáš Mládek 2021-12-21 16:05:27 +01:00
parent 5332d2faf0
commit b52d664cd4
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ use actix_web::error::{ErrorBadRequest, ErrorInternalServerError, ErrorNotFound}
use actix_web::{delete, error, get, post, put, web, Either, Error, HttpResponse};
use anyhow::Result;
use futures_util::StreamExt;
use log::{debug, info, trace};
use log::{debug, info, trace, error};
use serde::Deserialize;
use serde_json::json;
use std::collections::HashMap;
@ -62,6 +62,8 @@ pub async fn get_raw(
if !file_path.is_executable() {
opener::open(file_path).map_err(error::ErrorServiceUnavailable)?;
return Ok(Either::B(HttpResponse::NoContent().finish()));
} else {
error!("Attempted to natively open {:?}, which is executable!", file_path);
}
}
Err(error::ErrorForbidden(""))