Inadequate Error Handling in CLI Commands in cmd/commands.go
Summary
There is no proper error handling in initRootCmd function.
Vulnerability Detail
The initRootCmd function adds multiple commands to the root command without proper error handling. If an error occurs during the addition of these commands, it will not be captured or logged, leading to potential silent failures.
Impact
If an error occurs during the initialization of CLI commands, it may go unnoticed, causing certain commands to be unavailable or malfunction without any indication to the user. This can hinder the usability and reliability of the CLI.
Add error handling for each command addition to ensure any issues are captured and logged. This will help identify and debug problems during CLI initialization.
0xsi
High
Inadequate Error Handling in CLI Commands in
cmd/commands.go
Summary
There is no proper error handling in
initRootCmd
function.Vulnerability Detail
The
initRootCmd
function adds multiple commands to the root command without proper error handling. If an error occurs during the addition of these commands, it will not be captured or logged, leading to potential silent failures.Impact
If an error occurs during the initialization of CLI commands, it may go unnoticed, causing certain commands to be unavailable or malfunction without any indication to the user. This can hinder the usability and reliability of the CLI.
Code Snippet
https://github.com/sherlock-audit/2024-06-allora/blob/main/allora-chain/cmd/allorad/cmd/commands.go#L30-L49
Tool used
Manual Review
Recommendation
Add error handling for each command addition to ensure any issues are captured and logged. This will help identify and debug problems during CLI initialization.