dberr

command
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

dberr 示例:把数据库错误翻译为带业务码的 *Status。

演示 pkg/dberr:自定义 Driver.Classify(按哨兵 error 归类)、 Translate 产出 *pkg/errors.Status、WithMapping 覆盖默认映射。 模拟仓储层抛 driver error,网关层拿到带 Code 的错误。

Jump to

Keyboard shortcuts

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