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
|
|
@ -117,7 +117,11 @@ impl ServeSession {
|
|||
/// The project file is expected to be loaded out-of-band since it's
|
||||
/// currently loaded from the filesystem directly instead of through the
|
||||
/// in-memory filesystem layer.
|
||||
pub fn new<P: AsRef<Path>>(vfs: Vfs, start_path: P) -> Result<Self, ServeSessionError> {
|
||||
pub fn new<P: AsRef<Path>>(
|
||||
vfs: Vfs,
|
||||
start_path: P,
|
||||
critical_error_receiver: Option<crossbeam_channel::Receiver<memofs::WatcherCriticalError>>,
|
||||
) -> Result<Self, ServeSessionError> {
|
||||
let start_path = start_path.as_ref();
|
||||
let start_time = Instant::now();
|
||||
|
||||
|
|
@ -158,6 +162,7 @@ impl ServeSession {
|
|||
tree_mutation_receiver,
|
||||
Arc::clone(&suppressed_paths),
|
||||
root_project.folder_location().to_path_buf(),
|
||||
critical_error_receiver,
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue