You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to report an inconsistency in the behaviour of some @criticalmanufacturing/cli new commands.
Current Behavior:
Certain cmf/cli new commands, such as cmf new html and cmf new business, throw an exception when executed outside of an initialized project folder. This exception includes a stack trace but lacks a user-friendly error message.
For example:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
System.NullReferenceException: Object reference not set to an instance of an object.
at void Cmf.CLI.Commands.New.BusinessCommand.Execute(IDirectoryInfo workingDir, string version, bool addApplicationVersionAssembly) in /home/runner/work/cli/cli/cmf-cli/Commands/new/BusinessCommand.cs:61
In contrast, the cmf new data command, provide a clear and actionable error message when used outside of a project:
This command needs to run inside a project. Run 'cmf init' to create a new project.
Proposed Improvement:
I propose that all cmf/cli new commands be reviewed to ensure they provide a consistent and user-friendly error message when executed outside of an initialized project folder. This message should ideally be similar to the one provided by cmf new data.
Benefits:
Improved user experience by providing clear and actionable error messages.
Reduced debugging time for users encountering these errors.
Kind Regards,
João Moreira
The text was updated successfully, but these errors were encountered:
cmf-moreira
changed the title
Protec
cli new commands: Improve error handling for non-project contexts
Jan 23, 2025
Hi,
I want to report an inconsistency in the behaviour of some
@criticalmanufacturing/cli new
commands.Current Behavior:
Certain
cmf/cli new
commands, such ascmf new html
andcmf new business
, throw an exception when executed outside of an initialized project folder. This exception includes a stack trace but lacks a user-friendly error message.For example:
In contrast, the
cmf new data
command, provide a clear and actionable error message when used outside of a project:Proposed Improvement:
I propose that all
cmf/cli new
commands be reviewed to ensure they provide a consistent and user-friendly error message when executed outside of an initialized project folder. This message should ideally be similar to the one provided bycmf new data
.Benefits:
Kind Regards,
João Moreira
The text was updated successfully, but these errors were encountered: