mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +00:00
reorganize debug events
This commit is contained in:
parent
57dfe79568
commit
212ffeab79
10 changed files with 75 additions and 117 deletions
|
|
@ -61,7 +61,7 @@ impl Public {
|
|||
Ok(t) => match (t.is_dir(), t.is_file()) {
|
||||
(true, _) => callback(match self.list(&p) {
|
||||
Ok(list) => Response::Directory(query, list, p == self.public_dir),
|
||||
Err(e) => Response::InternalServerError(e.to_string()),
|
||||
Err(e) => Response::InternalServerError(query, e.to_string()),
|
||||
}),
|
||||
(_, true) => match fs::File::open(p) {
|
||||
Ok(mut f) => loop {
|
||||
|
|
@ -70,21 +70,24 @@ impl Public {
|
|||
Ok(0) => break,
|
||||
Ok(n) => callback(Response::File(&b[..n])),
|
||||
Err(e) => {
|
||||
return callback(Response::InternalServerError(format!(
|
||||
"failed to read response chunk for `{query}`: `{e}`"
|
||||
)));
|
||||
return callback(Response::InternalServerError(
|
||||
query,
|
||||
format!("failed to read response chunk: `{e}`"),
|
||||
));
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => callback(Response::InternalServerError(format!(
|
||||
"failed to read response for query`{query}`: `{e}`"
|
||||
))),
|
||||
Err(e) => callback(Response::InternalServerError(
|
||||
query,
|
||||
format!("failed to read response: `{e}`"),
|
||||
)),
|
||||
},
|
||||
_ => panic!(), // unexpected
|
||||
},
|
||||
Err(e) => callback(Response::InternalServerError(format!(
|
||||
"failed to read storage for `{query}`: `{e}`"
|
||||
))),
|
||||
Err(e) => callback(Response::InternalServerError(
|
||||
query,
|
||||
format!("failed to read storage: `{e}`"),
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue