Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/capabilities/errors/error.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package errors

import "fmt"
import (
"fmt"
)

type Origin int

Expand Down Expand Up @@ -110,6 +112,12 @@ func NewPublicUserError(err error, errorCode ErrorCode) Error {
return NewError(err, VisibilityPublic, OriginUser, errorCode)
}

// NewLimitBreachedError creates a public user error that embeds the provided limit error, indicating that a CRE limit
// breach has occurred. The error message will include the provided errorMsg as a prefix for additional context.
func NewLimitBreachedError(errorMsg string, err error) Error {
return NewPublicUserError(fmt.Errorf("%s: %w", errorMsg, err), LimitExceeded)
Comment on lines +117 to +118
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align on Exceeded?

Suggested change
func NewLimitBreachedError(errorMsg string, err error) Error {
return NewPublicUserError(fmt.Errorf("%s: %w", errorMsg, err), LimitExceeded)
func NewLimitExceededError(errorMsg string, err error) Error {
return NewPublicUserError(fmt.Errorf("%s: %w", errorMsg, err), LimitExceeded)

}
Comment on lines +115 to +119
Comment on lines +115 to +119
Comment on lines +115 to +119

// NewPrivateSystemError indicates that the wrapped error is due to a system-level issue and may contain
// sensitive information that should only be visible to the node on which it occurred. The error code will still be
// visible to other nodes in the network.
Expand Down
Loading