From: qydysky Date: Fri, 19 Apr 2024 17:36:06 +0000 (+0000) Subject: 1 X-Git-Tag: v0.28.20240419174055 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=aff1e93c5c3cdb33d260665f7fbe7b7c19f90b62;p=part%2F.git 1 --- diff --git a/component2/comp.go b/component2/comp.go index 14da24d..f91b794 100644 --- a/component2/comp.go +++ b/component2/comp.go @@ -1,17 +1,18 @@ package component2 import ( - "errors" "runtime" "strings" + + perrors "github.com/qydysky/part/errors" ) var pkgInterfaceMap = make(map[string]any) var ( - ErrEmptyPkgId = errors.New("ErrEmptyPkgId") - ErrRegistered = errors.New("ErrRegistered") - ErrGet = errors.New("ErrGet") + ErrEmptyPkgId = perrors.New("ErrEmptyPkgId") + ErrRegistered = perrors.New("ErrRegistered") + ErrGet = perrors.New("ErrGet") ) func PkgId(varId ...string) string { @@ -40,6 +41,6 @@ func Get[TargetInterface any](id string, init ...func(TargetInterface) TargetInt } return tmp } else { - panic(ErrGet) + panic(ErrGet.WithReason("ErrGet:" + id)) } }