Skip to main content

Module bin_errors

Module bin_errors 

Source
Expand description

Binary-level error handling for netspeed-cli.

This module contains the error presentation logic that is specific to the binary entry point. Library users should use the Error type directly without this presentation layer.

§Architecture

  • Exit codes following sysexits.h conventions
  • Machine-readable error output for JSON/JSONL formats
  • User-friendly error messages with suggestions

Modules§

exit_codes
Exit codes following sysexits.h conventions.

Structs§

MachineErrorBody
MachineErrorOutput

Functions§

is_config_error
Check if the error is a configuration/validation error.
is_list_sentinel
Check if the error is the “–list was shown” sentinel.
is_network_error
Check if the error is network-related.
machine_error_format
Determine machine-readable error format from CLI args.
machine_error_identity
Map error to machine-readable code and category.
print_error
Print a user-friendly error message.
print_machine_error
Output machine-readable error.
render_machine_error
Render error to machine-readable string.
select_exit_code
Select exit code based on error type.
suggestion_for_error
Get suggestion text for error type.