The issue this pull request attempts to resolve is the error messages produced by rectx.
Rectx will produce programmer errors (errors that are not easily readable to the average person unless they have knowledge of how Rust and ReCTx works) which even for ReCT programmers may be confusing.
Furthermore, it is possible for many different kinds of errors to be produced by the manager module even if most functions can return a std::io::Error through a Result<T, E> enum.
This pull request should close the issue described in #2.
Solution
This pull request solves the issue above by refactoring the error system.
To begin with, the cli module now has a multitude of help functions now:
cli::abort(String): send a message to the user, and calls panic!() clearing the stack and aborting the entire program
cli::issue(String): when a recoverable error is found, message reports the issue to the user.
cli::info(String): this is just for sending non-specific information to the user
cli::process(String): for reporting the beginning of a process to the user
cli::success(Stirng): for reporting a successful result or process to the user
These helper functions are available to every module and allow for future modifications to the error system without major refactoring (like editing every println!.. etc).
The following cli module functions have had their error handling improved through detecting ErrorKind and reporting more specific error messages:
Issue
The issue this pull request attempts to resolve is the error messages produced by rectx. Rectx will produce programmer errors (errors that are not easily readable to the average person unless they have knowledge of how Rust and ReCTx works) which even for ReCT programmers may be confusing.
Furthermore, it is possible for many different kinds of errors to be produced by the manager module even if most functions can return a
std::io::Error
through aResult<T, E>
enum.This pull request should close the issue described in #2.
Solution
This pull request solves the issue above by refactoring the error system. To begin with, the cli module now has a multitude of help functions now:
panic!()
clearing the stack and aborting the entire programThese helper functions are available to every module and allow for future modifications to the error system without major refactoring (like editing every println!.. etc).
The following cli module functions have had their error handling improved through detecting
ErrorKind
and reporting more specific error messages:run_project()
(throughgenerate_executable_error_handle()
)build_project()
(throughgenerate_executable_error_handle()
)new_project()