mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-01 23:42:33 +03:00
chore(tauri) better error message for asset_response
This commit is contained in:
parent
b92eee019c
commit
5b15552ed5
@ -1,9 +1,10 @@
|
||||
use tiny_http::{Header, Response};
|
||||
|
||||
pub fn asset_response(path: &str) -> Response<std::io::Cursor<Vec<u8>>> {
|
||||
let asset_path = &format!("{}{}", env!("TAURI_DIST_DIR"), path);
|
||||
let asset = crate::assets::ASSETS
|
||||
.get(&format!("{}{}", env!("TAURI_DIST_DIR"), path))
|
||||
.expect("Could not get assets")
|
||||
.get(asset_path)
|
||||
.expect(&format!("Could not read asset {}", asset_path))
|
||||
.into_owned();
|
||||
let mut response = Response::from_data(asset);
|
||||
let header;
|
||||
|
Loading…
Reference in New Issue
Block a user