mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Enhance VFS initialization and error handling
- Introduced a new method `new_default_with_errors` in the VFS implementation to create a VFS instance with a critical error receiver for monitoring watcher health. - Updated the `ServeSession` constructor to accept an optional critical error receiver, allowing for better error management during session initialization. - Adjusted various calls to `ServeSession::new` across the codebase to accommodate the new parameter, ensuring consistent error handling. - Improved logging in the API context and serve session files for better clarity during server operations. These changes enhance the robustness of the VFS and session management, providing better tools for error detection and handling.
This commit is contained in:
parent
ec7f91017b
commit
8462c06b82
14 changed files with 1784 additions and 1600 deletions
|
|
@ -130,6 +130,10 @@ impl TestServeSession {
|
|||
&self.project_path
|
||||
}
|
||||
|
||||
pub fn port(&self) -> usize {
|
||||
self.port
|
||||
}
|
||||
|
||||
/// Waits for the `rojo serve` server to come online with expontential
|
||||
/// backoff.
|
||||
pub fn wait_to_come_online(&mut self) -> ServerInfoResponse {
|
||||
|
|
@ -284,7 +288,13 @@ impl TestServeSession {
|
|||
/// Panics with drift counts if any discrepancy is found.
|
||||
pub fn assert_tree_fresh(&self) {
|
||||
let url = format!("http://localhost:{}/api/validate-tree", self.port);
|
||||
let body = reqwest::blocking::get(url)
|
||||
let client = reqwest::blocking::Client::builder()
|
||||
.timeout(Duration::from_secs(60))
|
||||
.build()
|
||||
.expect("Failed to build reqwest client");
|
||||
let body = client
|
||||
.get(&url)
|
||||
.send()
|
||||
.expect("Failed to call /api/validate-tree")
|
||||
.bytes()
|
||||
.expect("Failed to read validate-tree response body");
|
||||
|
|
@ -472,9 +482,7 @@ pub fn fresh_rebuild_read(project_path: &Path) -> NormalizedInstance {
|
|||
match reqwest::blocking::get(&url) {
|
||||
Ok(resp) => {
|
||||
if let Ok(body) = resp.bytes() {
|
||||
if let Ok(server_info) =
|
||||
deserialize_msgpack::<ServerInfoResponse>(&body)
|
||||
{
|
||||
if let Ok(server_info) = deserialize_msgpack::<ServerInfoResponse>(&body) {
|
||||
info = Some(server_info);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue