Module Peertube_auth.Error

Error handling for PeerTube CLI.

This module provides utilities for handling errors and managing exit codes in the CLI.

Exit Codes

exception Exit_code of int

Exception for CLI exit codes.

Error Handling

val handle_exn : exn -> int

handle_exn exn handles an exception and returns an exit code. Prints formatted error messages for known error types.

val wrap : (unit -> int) -> int

wrap f wraps a function to handle errors and return exit codes. Catches exceptions and converts them to appropriate exit codes.

Error Reporting

val exit_with : int -> 'a

exit_with code raises Exit_code code.

val fail : string -> 'a

fail msg prints an error message and exits with code 1.