gerr-cosmos

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MIT

README

gerr-cosmos

What?

A set of concrete error types to use as a basis for errors across your cosmos sdk application.

Why?

In modern idiomatic golang it is normal to almost mimic a stack trace by wrapping errors at appropriate moments. Errors should be handled at caller level using errors.Is() and related utilities from the standard library.

If done wrong, this leads to a proliferation of error types, and bug prone code.

This library follows Google API design guidelines

Individual APIs must avoid defining additional error codes, since developers are very unlikely to write logic to handle a large number of error codes. For reference, handling an average of three error codes per API call would mean most application logic would just be for error handling, which would not be a good developer experience.

The philosophy is to use a small set of well thought out errors as first class citizens in your program.

This library extends the selection of Google errors with a few ubiquitous errors encountered in Cosmos/Blockchain applications.

Contributing

Suggestions, PRs, pointing-out-of-mistakes, all welcome 🙌

Basis

This lib is actually a wrapper around a more general purpose library.

Directories

Path Synopsis
Package gerrc extends the canonical google API design guideline errors with cosmos sdk registration.
Package gerrc extends the canonical google API design guideline errors with cosmos sdk registration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL