api/go-log/error.go
Virgil 16abc45efa feat(api): add stable openapi operation ids
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 07:36:35 +00:00

14 lines
339 B
Go

// SPDX-License-Identifier: EUPL-1.2
package log
import "fmt"
// E wraps an operation label and message in a conventional error.
// If err is non-nil, it is wrapped with %w.
func E(op, message string, err error) error {
if err != nil {
return fmt.Errorf("%s: %s: %w", op, message, err)
}
return fmt.Errorf("%s: %s", op, message)
}