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