handleException static method
void
handleException(
- ProjectCommandError type,
- dynamic exception,
- String context, {
- bool isExit = true,
Handles exceptions with contextual error information.
Parameters:
type: Error categoryexception: The caught exceptioncontext: Additional context about the operationisExit: Whether to exit the process (default: true)
Implementation
static void handleException(
ProjectCommandError type,
dynamic exception,
String context, {
bool isExit = true,
}) {
final errorInfo = _getErrorInfo(type);
StatusHelper.failed(
'$context: ${exception.toString()}',
suggestion: errorInfo['suggestion'],
examples: errorInfo['examples'],
isExit: isExit,
);
}