docs: lint (#24854)

This commit is contained in:
Alex | Interchain Labs
2025-06-11 10:20:44 -04:00
committed by GitHub
parent 1b72b047e2
commit 78bb60a377
33 changed files with 178 additions and 147 deletions
+1 -1
View File
@@ -1 +1 @@
# Errors␍␍This package provides structured error handling for Cosmos SDK apps. It supports:␍␍- Custom error codes and messages␍- Stack traces when wrapping errors␍- ABCI-compatible responses for Tendermint␍- Optional gRPC status codes␍␍## Usage␍␍### Registering Errors␍␍Define root errors with a unique code and description:␍␍```go␍var ErrInvalidInput = errors.Register("app", 1001, "invalid input")␍```␍␍You can wrap errors to add context:␍␍```go␍return errors.Wrap(ErrInvalidInput, "missing field")␍```␍␍### Getting ABCI Error Info␍␍To convert an error to ABCI-compatible output:␍␍```go␍codespace, code, log := errors.ABCIInfo(err, debug)␍```␍␍Set `debug = true` to include stack traces in logs.␍␍### Suppress Duplicate Error Warnings␍␍To prevent logging when the same error is registered twice, set:␍␍```bash␍export COSMOS_SDK_SUPPRESS_DUPLICATE_ERROR_CODE_LOG=true␍```␍␍Useful in tests or modules that may re-register the same error.␍
# Errors␍␍This package provides structured error handling for Cosmos SDK apps. It supports:␍␍* Custom error codes and messages␍* Stack traces when wrapping errors␍* ABCI-compatible responses for Tendermint␍* Optional gRPC status codes␍␍## Usage␍␍### Registering Errors␍␍Define root errors with a unique code and description:␍␍```go␍var ErrInvalidInput = errors.Register("app", 1001, "invalid input")␍```␍␍You can wrap errors to add context:␍␍```go␍return errors.Wrap(ErrInvalidInput, "missing field")␍```␍␍### Getting ABCI Error Info␍␍To convert an error to ABCI-compatible output:␍␍```go␍codespace, code, log := errors.ABCIInfo(err, debug)␍```␍␍Set `debug = true` to include stack traces in logs.␍␍### Suppress Duplicate Error Warnings␍␍To prevent logging when the same error is registered twice, set:␍␍```bash␍export COSMOS_SDK_SUPPRESS_DUPLICATE_ERROR_CODE_LOG=true␍```␍␍Useful in tests or modules that may re-register the same error.␍