Class WanakuExceptionHandler

java.lang.Object
ai.wanaku.cli.main.support.WanakuExceptionHandler
All Implemented Interfaces:
picocli.CommandLine.IExecutionExceptionHandler

public class WanakuExceptionHandler extends Object implements picocli.CommandLine.IExecutionExceptionHandler
Centralized exception handler for the Wanaku CLI.

This handler provides user-friendly error messages for common exceptions that occur during command execution, replacing verbose stack traces with actionable error information. It implements Picocli's CommandLine.IExecutionExceptionHandler interface to intercept exceptions before they reach the user.

Supported exception types:

The handler can operate in two modes:

  • Normal mode: Displays concise, user-friendly error messages
  • Verbose mode: Shows full stack traces for debugging
  • Constructor Details

    • WanakuExceptionHandler

      public WanakuExceptionHandler()
  • Method Details

    • handleExecutionException

      public int handleExecutionException(Exception ex, picocli.CommandLine commandLine, picocli.CommandLine.ParseResult parseResult) throws Exception
      Specified by:
      handleExecutionException in interface picocli.CommandLine.IExecutionExceptionHandler
      Throws:
      Exception