Errors
Part of the Entiqon::Common toolkit.
🌱 Overview¶
The errors package provides extended error handling utilities for Entiqon.
It builds on Go's standard error interface by introducing structured
errors that carry additional context.
✨ Features¶
- CausableError
An error that has both: Cause()→ short identifier for the category of error (e.g.,"Database")-
Reason()→ detailed explanation for logs or user messages -
ProcessStageError
ExtendsCausableErrorby associating an error with aProcessStage. Useful for tracing errors in multi-step processing pipelines.
🚀 Quick Start¶
import "github.com/entiqon/entiqon/common/errors"
// Create a simple causable error
err := errors.NewCausableError("Database", "Connection failed")
// Create a process stage error
pse := errors.NewProcessStageError("Init", "Loader", "Failed to load resource", err)
📘 Guides¶
- Use
Cause()to classify errors programmatically - Use
Reason()orError()for logging and display - Use
ProcessStageError.Stage()to trace where the error occurred - Errors support Go's
errors.Isanderrors.Asfor unwrapping
📄 License¶
MIT — © Entiqon Team