summaryrefslogtreecommitdiff
path: root/mingling_core/src/program
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-01 16:30:10 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-01 16:30:10 +0800
commit0cb8ccca6e4fc2b433f6a2492b2cdfd96751ca40 (patch)
tree15b78b8aeb303593202f00ca78124ebeeaf8ab86 /mingling_core/src/program
parent3de10ca22cca06c4d9069984d0e66e370a331dde (diff)
Add default error handling methods to ProgramCollect trait
The trait now includes `build_renderer_not_found` and `build_dispatcher_not_found` methods for constructing error outputs. The macro generates implementations that create appropriate error types, removing hardcoded enum variants.
Diffstat (limited to 'mingling_core/src/program')
-rw-r--r--mingling_core/src/program/exec.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/mingling_core/src/program/exec.rs b/mingling_core/src/program/exec.rs
index cdbb2b0..bf025fd 100644
--- a/mingling_core/src/program/exec.rs
+++ b/mingling_core/src/program/exec.rs
@@ -28,7 +28,7 @@ where
}
Err(ProgramInternalExecuteError::DispatcherNotFound) => {
// No matching Dispatcher is found
- return Err(ProgramInternalExecuteError::DispatcherNotFound);
+ current = C::build_dispatcher_not_found(program.args);
}
Err(e) => return Err(e),
};
@@ -51,8 +51,7 @@ where
}
// No renderer exists
else {
- let renderer_name = current.member_id.to_string();
- return Err(ProgramInternalExecuteError::RendererNotFound(renderer_name));
+ C::build_renderer_not_found(current.member_id)
}
};
}