Per issue #24, users of the Veyoze CLI, particularly when executing the 'php veyoze provision' command, are faced with lengthy and ambiguous error messages due to the ValidationException. This issue arises during site creation when the OrCreateNewSite class triggers the createSite function from Forge. In cases of invalid payload data, the system throws a ValidationException. However, the subsequent stack trace doesn't clearly delineate the root cause to the end-user.
Expected Behavior
Users should receive a clear, concise error message detailing what part of their input is invalid when a ValidationException occurs.
Proposed Solution
I propose we refine the Exception Handler for this particular exception. When a ValidationException is caught, we should:
Extract the validation error messages from the exception.
Display these validation messages clearly in the CLI output.
Prevent the propagation of the exception to the default logging stack to avoid long, unclear stack traces. This can be achieved by returning false from the exception handling callback, thereby halting further exception handling.
Steps to Reproduce
Run 'php veyoze provision' with an incorrect data value in the payload. For example, set FORGE_NGINX_TEMPLATE to a random number.
Observe the long, unclear stack-trace output when a ValidationException is thrown.
Additional Context
Clearer error messages will improve user experience by quickly informing users of mistakes in their input, allowing for quicker debugging and fewer frustrations.
Description
Per issue #24, users of the Veyoze CLI, particularly when executing the 'php veyoze provision' command, are faced with lengthy and ambiguous error messages due to the
ValidationException
. This issue arises during site creation when theOrCreateNewSite
class triggers thecreateSite
function from Forge. In cases of invalid payload data, the system throws aValidationException
. However, the subsequent stack trace doesn't clearly delineate the root cause to the end-user.Expected Behavior
Users should receive a clear, concise error message detailing what part of their input is invalid when a
ValidationException
occurs.Proposed Solution
I propose we refine the Exception Handler for this particular exception. When a
ValidationException
is caught, we should:false
from the exception handling callback, thereby halting further exception handling.Steps to Reproduce
FORGE_NGINX_TEMPLATE
to a random number.ValidationException
is thrown.Additional Context
Clearer error messages will improve user experience by quickly informing users of mistakes in their input, allowing for quicker debugging and fewer frustrations.