all: fix error naming

errs.Class should not contain "error" in the name, since that causes a
lot of stutter in the error logs. As an example a log line could end up
looking like:

    ERROR node stats service error: satellitedbs error: node stats database error: no rows

Whereas something like:

    ERROR nodestats service: satellitedbs: nodestatsdb: no rows

Would contain all the necessary information without the stutter.

Change-Id: I7b7cb7e592ebab4bcfadc1eef11122584d2b20e0
This commit is contained in:
Egon Elbre 2021-04-28 11:06:17 +03:00
parent 30d2a2ea7b
commit 961e841bd7
89 changed files with 112 additions and 112 deletions

View File

@ -38,9 +38,9 @@ const (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error is used when an error occurs involving an authorization. // Error is used when an error occurs involving an authorization.
Error = errs.Class("authorization error") Error = errs.Class("authorization")
// ErrInvalidToken is used when a token is invalid. // ErrInvalidToken is used when a token is invalid.
ErrInvalidToken = errs.Class("authorization token error") ErrInvalidToken = errs.Class("authorization token")
) )
// Group is a slice of authorizations for convenient de/serialization. // Group is a slice of authorizations for convenient de/serialization.

View File

@ -20,19 +20,19 @@ import (
var ( var (
// ErrDB is used when an error occurs involving the authorization database. // ErrDB is used when an error occurs involving the authorization database.
ErrDB = errs.Class("authorization db error") ErrDB = errs.Class("authorizationdb")
// ErrEmptyUserID is used when a user ID is required but not provided. // ErrEmptyUserID is used when a user ID is required but not provided.
ErrEmptyUserID = ErrDB.New("userID cannot be empty") ErrEmptyUserID = ErrDB.New("userID cannot be empty")
// ErrCount is used when attempting to create an invalid number of authorizations. // ErrCount is used when attempting to create an invalid number of authorizations.
ErrCount = ErrDB.New("cannot add less than one authorization") ErrCount = ErrDB.New("cannot add less than one authorization")
// ErrInvalidClaim is used when a claim is invalid due to some user input. // ErrInvalidClaim is used when a claim is invalid due to some user input.
ErrInvalidClaim = errs.Class("authorization claim error") ErrInvalidClaim = errs.Class("invalid authorization claim")
// ErrAlreadyClaimed is used when a valid claim is attempted with a token that's been used already. // ErrAlreadyClaimed is used when a valid claim is attempted with a token that's been used already.
ErrAlreadyClaimed = errs.Class("authorization already claimed") ErrAlreadyClaimed = errs.Class("authorization already claimed")
// ErrNotFound is used when there is no matching authorization in the DB for a given userID and token. // ErrNotFound is used when there is no matching authorization in the DB for a given userID and token.
ErrNotFound = errs.Class("authorization not found") ErrNotFound = errs.Class("authorization not found")
// ErrDBInternal is used when an internal error occurs involving the authorization database. // ErrDBInternal is used when an internal error occurs involving the authorization database.
ErrDBInternal = errs.Class("internal authorization db error") ErrDBInternal = errs.Class("internal authorization db")
) )
// DB stores authorizations which may be claimed in exchange for a // DB stores authorizations which may be claimed in exchange for a

View File

@ -19,7 +19,7 @@ import (
) )
// ErrEndpoint is the default error class for the authorization endpoint. // ErrEndpoint is the default error class for the authorization endpoint.
var ErrEndpoint = errs.Class("authorization endpoint error") var ErrEndpoint = errs.Class("authorization endpoint")
// Endpoint provides a http endpoint for interacting with an authorization service. // Endpoint provides a http endpoint for interacting with an authorization service.
type Endpoint struct { type Endpoint struct {

View File

@ -12,7 +12,7 @@ import (
) )
// ErrService is the default error class for the authorization service. // ErrService is the default error class for the authorization service.
var ErrService = errs.Class("authorization service error") var ErrService = errs.Class("authorization service")
// Service is the authorization service. // Service is the authorization service.
type Service struct { type Service struct {

View File

@ -25,7 +25,7 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is the default error class for the certificates peer. // Error is the default error class for the certificates peer.
Error = errs.Class("certificates peer error") Error = errs.Class("certificate")
) )
// Config is the global certificates config. // Config is the global certificates config.

View File

@ -21,7 +21,7 @@ type verifyConfig struct {
} }
var ( var (
errVerify = errs.Class("Verify error") errVerify = errs.Class("verify")
verifyCmd = &cobra.Command{ verifyCmd = &cobra.Command{
Use: "verify", Use: "verify",
Short: "Verify identity and CA certificate chains are valid", Short: "Verify identity and CA certificate chains are valid",

View File

@ -16,7 +16,7 @@ import (
var ( var (
// ErrSetup is used when an error occurs while setting up. // ErrSetup is used when an error occurs while setting up.
ErrSetup = errs.Class("setup error") ErrSetup = errs.Class("setup")
idCmd = &cobra.Command{ idCmd = &cobra.Command{
Use: "id", Use: "id",

View File

@ -38,16 +38,16 @@ var (
CSVPath string CSVPath string
// ErrInspectorDial throws when there are errors dialing the inspector server. // ErrInspectorDial throws when there are errors dialing the inspector server.
ErrInspectorDial = errs.Class("error dialing inspector server:") ErrInspectorDial = errs.Class("dialing inspector server")
// ErrRequest is for request errors after dialing. // ErrRequest is for request errors after dialing.
ErrRequest = errs.Class("error processing request:") ErrRequest = errs.Class("processing request")
// ErrIdentity is for errors during identity creation for this CLI. // ErrIdentity is for errors during identity creation for this CLI.
ErrIdentity = errs.Class("error creating identity:") ErrIdentity = errs.Class("creating identity")
// ErrArgs throws when there are errors with CLI args. // ErrArgs throws when there are errors with CLI args.
ErrArgs = errs.Class("error with CLI args:") ErrArgs = errs.Class("invalid CLI args")
irreparableLimit int32 irreparableLimit int32

View File

@ -18,7 +18,7 @@ import (
var ( var (
// ErrNodes is an internal error type for nodes web api controller. // ErrNodes is an internal error type for nodes web api controller.
ErrNodes = errs.Class("nodes web api controller error") ErrNodes = errs.Class("nodes web api controller")
) )
// Nodes is a web api controller. // Nodes is a web api controller.

View File

@ -15,7 +15,7 @@ import (
var ( var (
// ErrPayouts is an internal error type for payouts web api controller. // ErrPayouts is an internal error type for payouts web api controller.
ErrPayouts = errs.Class("payouts web api controller error") ErrPayouts = errs.Class("payouts web api controller")
) )
// Payouts is a web api controller. // Payouts is a web api controller.

View File

@ -22,7 +22,7 @@ import (
var ( var (
// Error is an error class for internal Multinode Dashboard http server error. // Error is an error class for internal Multinode Dashboard http server error.
Error = errs.Class("multinode console server error") Error = errs.Class("multinode console server")
) )
// Config contains configuration for Multinode Dashboard http server. // Config contains configuration for Multinode Dashboard http server.

View File

@ -26,7 +26,7 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is the default multinodedb errs class. // Error is the default multinodedb errs class.
Error = errs.Class("multinodedb internal error") Error = errs.Class("multinodedb")
) )
// multinodeDB combines access to different database tables with a record // multinodeDB combines access to different database tables with a record

View File

@ -14,7 +14,7 @@ var mon = monkit.Package()
func init() { func init() {
// catch dbx errors // catch dbx errors
class := errs.Class("multinodedb dbx error") class := errs.Class("multinodedb dbx")
WrapErr = func(e *Error) error { WrapErr = func(e *Error) error {
if e.Code == ErrorCode_NoRows { if e.Code == ErrorCode_NoRows {
return e.Err return e.Err

View File

@ -16,7 +16,7 @@ import (
) )
// MembersDBError indicates about internal MembersDB error. // MembersDBError indicates about internal MembersDB error.
var MembersDBError = errs.Class("MembersDB error") var MembersDBError = errs.Class("MembersDB")
// ensures that members implements console.Members. // ensures that members implements console.Members.
var _ console.Members = (*members)(nil) var _ console.Members = (*members)(nil)

View File

@ -16,7 +16,7 @@ import (
) )
// ErrNodesDB indicates about internal NodesDB error. // ErrNodesDB indicates about internal NodesDB error.
var ErrNodesDB = errs.Class("NodesDB error") var ErrNodesDB = errs.Class("NodesDB")
// ensures that nodesdb implements console.Nodes. // ensures that nodesdb implements console.Nodes.
var _ nodes.DB = (*nodesdb)(nil) var _ nodes.DB = (*nodesdb)(nil)

View File

@ -20,7 +20,7 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is an error class for nodes service error. // Error is an error class for nodes service error.
Error = errs.Class("nodes service error") Error = errs.Class("nodes")
) )
// Service exposes all nodes related logic. // Service exposes all nodes related logic.

View File

@ -19,7 +19,7 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error is an error class for payouts service error. // Error is an error class for payouts service error.
Error = errs.Class("payouts service error") Error = errs.Class("payouts")
) )
// Service exposes all payouts related logic. // Service exposes all payouts related logic.

View File

@ -21,11 +21,11 @@ import (
var ( var (
// ErrValidateVersionQuery is when there is an error querying version table. // ErrValidateVersionQuery is when there is an error querying version table.
ErrValidateVersionQuery = errs.Class("validate db version query error") ErrValidateVersionQuery = errs.Class("validate db version query")
// ErrValidateVersionMismatch is when the migration version does not match the current database version. // ErrValidateVersionMismatch is when the migration version does not match the current database version.
ErrValidateVersionMismatch = errs.Class("validate db version mismatch error") ErrValidateVersionMismatch = errs.Class("validate db version mismatch")
// ErrValidateMinVersion is when the migration version does not match the current database version. // ErrValidateMinVersion is when the migration version does not match the current database version.
ErrValidateMinVersion = errs.Class("validate minimum version error") ErrValidateMinVersion = errs.Class("validate minimum version")
) )
/* /*

View File

@ -17,7 +17,7 @@ var DefaultWalletFeaturesValidation = WalletFeaturesValidation{
} }
// WalletFeatureValidationError wallet feature validation errors class. // WalletFeatureValidationError wallet feature validation errors class.
var WalletFeatureValidationError = errs.Class("wallet feature validation error") var WalletFeatureValidationError = errs.Class("wallet feature validation")
// WalletFeaturesValidation contains config for wallet feature validation. // WalletFeaturesValidation contains config for wallet feature validation.
type WalletFeaturesValidation struct { type WalletFeaturesValidation struct {

View File

@ -38,7 +38,7 @@ type Part struct {
} }
// Error is the default message errs class. // Error is the default message errs class.
var Error = errs.Class("Email message error") var Error = errs.Class("Email message")
// Bytes builds message and returns result as bytes. // Bytes builds message and returns result as bytes.
func (msg *Message) Bytes() (data []byte, err error) { func (msg *Message) Bytes() (data []byte, err error) {

View File

@ -12,5 +12,5 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is a pkg/quic error. // Error is a pkg/quic error.
Error = errs.Class("quic error") Error = errs.Class("quic")
) )

View File

@ -20,8 +20,8 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error is a pkg/revocation error. // Error is a revocation error.
Error = errs.Class("revocation error") Error = errs.Class("revocation")
) )
// DB stores the most recently seen revocation for each nodeID // DB stores the most recently seen revocation for each nodeID

View File

@ -12,5 +12,5 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is a pkg/server error. // Error is a pkg/server error.
Error = errs.Class("server error") Error = errs.Class("server")
) )

View File

@ -22,8 +22,8 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error is the error class for version control client errors. // Error is the error class for version checker client errors.
Error = errs.Class("version control client error") Error = errs.Class("version checker client")
) )
// ClientConfig is the config struct for the version control client. // ClientConfig is the config struct for the version control client.

View File

@ -27,7 +27,7 @@ var (
ErrInvalidArgument = errs.Class("invalid argument") ErrInvalidArgument = errs.Class("invalid argument")
// ErrSystemOrNetError is returned when the used storage backend returns an // ErrSystemOrNetError is returned when the used storage backend returns an
// internal system or network error. // internal system or network error.
ErrSystemOrNetError = errs.Class("backend system error") ErrSystemOrNetError = errs.Class("accounting backend")
// ErrKeyNotFound is returned when the key is not found in the cache. // ErrKeyNotFound is returned when the key is not found in the cache.
ErrKeyNotFound = errs.Class("key not found") ErrKeyNotFound = errs.Class("key not found")
// ErrUnexpectedValue is returned when an unexpected value according the // ErrUnexpectedValue is returned when an unexpected value according the

View File

@ -16,11 +16,11 @@ import (
var ( var (
// ErrProjectLimitType error for project limit type. // ErrProjectLimitType error for project limit type.
ErrProjectLimitType = errs.Class("project limit type error") ErrProjectLimitType = errs.Class("project limit type")
// ErrGetProjectLimit error for getting project limits from database. // ErrGetProjectLimit error for getting project limits from database.
ErrGetProjectLimit = errs.Class("get project limits error") ErrGetProjectLimit = errs.Class("get project limits")
// ErrGetProjectLimitCache error for getting project limits from cache. // ErrGetProjectLimitCache error for getting project limits from cache.
ErrGetProjectLimitCache = errs.Class("get project limits from cache error") ErrGetProjectLimitCache = errs.Class("get project limits from cache")
) )
// ProjectLimitDB stores information about projects limits for storage and bandwidth limits. // ProjectLimitDB stores information about projects limits for storage and bandwidth limits.

View File

@ -19,7 +19,7 @@ var mon = monkit.Package()
var ( var (
// ErrProjectUsage general error for project usage. // ErrProjectUsage general error for project usage.
ErrProjectUsage = errs.Class("project usage error") ErrProjectUsage = errs.Class("project usage")
) )
// Service is handling project usage related logic. // Service is handling project usage related logic.

View File

@ -10,6 +10,6 @@ import (
// Error is a standard error class for this package. // Error is a standard error class for this package.
var ( var (
Error = errs.Class("rollup error") Error = errs.Class("rollup")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -17,7 +17,7 @@ import (
// Error is a standard error class for this package. // Error is a standard error class for this package.
var ( var (
Error = errs.Class("rolluparchive error") Error = errs.Class("rolluparchive")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -21,7 +21,7 @@ import (
// Error is a standard error class for this package. // Error is a standard error class for this package.
var ( var (
Error = errs.Class("tally error") Error = errs.Class("tally")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -15,7 +15,7 @@ import (
var ( var (
// ContainError is the containment errs class. // ContainError is the containment errs class.
ContainError = errs.Class("containment error") ContainError = errs.Class("containment")
// ErrContainedNotFound is the errs class for when a pending audit isn't found. // ErrContainedNotFound is the errs class for when a pending audit isn't found.
ErrContainedNotFound = errs.Class("pending audit not found") ErrContainedNotFound = errs.Class("pending audit not found")

View File

@ -16,7 +16,7 @@ import (
) )
// Error is the default audit errs class. // Error is the default audit errs class.
var Error = errs.Class("audit error") var Error = errs.Class("audit")
// Config contains configurable values for audit chore and workers. // Config contains configurable values for audit chore and workers.
type Config struct { type Config struct {

View File

@ -42,7 +42,7 @@ const authKey key = 0
const requestKey key = 1 const requestKey key = 1
// ErrUnauthorized is error class for authorization related errors. // ErrUnauthorized is error class for authorization related errors.
var ErrUnauthorized = errs.Class("unauthorized error") var ErrUnauthorized = errs.Class("unauthorized")
// Authorization contains auth info of authorized User. // Authorization contains auth info of authorized User.
type Authorization struct { type Authorization struct {

View File

@ -17,7 +17,7 @@ import (
var ( var (
// ErrAnalyticsAPI - console analytics api error type. // ErrAnalyticsAPI - console analytics api error type.
ErrAnalyticsAPI = errs.Class("console analytics api error") ErrAnalyticsAPI = errs.Class("consoleapi analytics")
) )
// Analytics is an api controller that exposes analytics related functionality. // Analytics is an api controller that exposes analytics related functionality.

View File

@ -16,7 +16,7 @@ import (
var ( var (
// ErrAPIKeysAPI - console api keys api error type. // ErrAPIKeysAPI - console api keys api error type.
ErrAPIKeysAPI = errs.Class("console api keys api error") ErrAPIKeysAPI = errs.Class("consoleapi keys")
) )
// APIKeys is an api controller that exposes all api keys related functionality. // APIKeys is an api controller that exposes all api keys related functionality.

View File

@ -24,7 +24,7 @@ import (
var ( var (
// ErrAuthAPI - console auth api error type. // ErrAuthAPI - console auth api error type.
ErrAuthAPI = errs.Class("console auth api error") ErrAuthAPI = errs.Class("consoleapi auth")
// errNotImplemented is the error value used by handlers of this package to // errNotImplemented is the error value used by handlers of this package to
// response with status Not Implemented. // response with status Not Implemented.

View File

@ -16,7 +16,7 @@ import (
var ( var (
// ErrBucketsAPI - console buckets api error type. // ErrBucketsAPI - console buckets api error type.
ErrBucketsAPI = errs.Class("console buckets api error") ErrBucketsAPI = errs.Class("consoleapi buckets")
) )
// Buckets is an api controller that exposes all buckets related functionality. // Buckets is an api controller that exposes all buckets related functionality.

View File

@ -21,7 +21,7 @@ import (
var ( var (
// ErrPaymentsAPI - console payments api error type. // ErrPaymentsAPI - console payments api error type.
ErrPaymentsAPI = errs.Class("console payments api error") ErrPaymentsAPI = errs.Class("consoleapi payments")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -54,7 +54,7 @@ const (
var ( var (
// Error is satellite console error type. // Error is satellite console error type.
Error = errs.Class("satellite console error") Error = errs.Class("consoleweb")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -59,19 +59,19 @@ const (
var ( var (
// Error describes internal console error. // Error describes internal console error.
Error = errs.Class("service error") Error = errs.Class("console service")
// ErrNoMembership is error type of not belonging to a specific project. // ErrNoMembership is error type of not belonging to a specific project.
ErrNoMembership = errs.Class("no membership error") ErrNoMembership = errs.Class("no membership")
// ErrTokenExpiration is error type of token reached expiration time. // ErrTokenExpiration is error type of token reached expiration time.
ErrTokenExpiration = errs.Class("token expiration error") ErrTokenExpiration = errs.Class("token expiration")
// ErrProjLimit is error type of project limit. // ErrProjLimit is error type of project limit.
ErrProjLimit = errs.Class("project limit error") ErrProjLimit = errs.Class("project limit")
// ErrUsage is error type of project usage. // ErrUsage is error type of project usage.
ErrUsage = errs.Class("project usage error") ErrUsage = errs.Class("project usage")
// ErrEmailUsed is error type that occurs on repeating auth attempts with email. // ErrEmailUsed is error type that occurs on repeating auth attempts with email.
ErrEmailUsed = errs.Class("email used") ErrEmailUsed = errs.Class("email used")

View File

@ -131,7 +131,7 @@ func TestService(t *testing.T) {
// deleting a project with a bucket should fail // deleting a project with a bucket should fail
err = service.DeleteProject(authCtx2, up2Pro1.ID) err = service.DeleteProject(authCtx2, up2Pro1.ID)
require.Error(t, err) require.Error(t, err)
require.Equal(t, "service error: project usage error: some buckets still exist", err.Error()) require.Equal(t, "console service: project usage: some buckets still exist", err.Error())
}) })
t.Run("TestChangeEmail", func(t *testing.T) { t.Run("TestChangeEmail", func(t *testing.T) {

View File

@ -12,7 +12,7 @@ const (
) )
// ErrValidation validation related error class. // ErrValidation validation related error class.
var ErrValidation = errs.Class("validation error") var ErrValidation = errs.Class("validation")
// validationError is slice of ErrValidation class errors. // validationError is slice of ErrValidation class errors.
type validationErrors []error type validationErrors []error

View File

@ -19,9 +19,9 @@ import (
) )
var ( var (
errPingBackDial = errs.Class("pingback dialing error") errPingBackDial = errs.Class("pingback dialing")
errCheckInIdentity = errs.Class("check-in identity error") errCheckInIdentity = errs.Class("check-in identity")
errCheckInNetwork = errs.Class("check-in network error") errCheckInNetwork = errs.Class("check-in network")
) )
// Endpoint implements the contact service Endpoints. // Endpoint implements the contact service Endpoints.

View File

@ -23,7 +23,7 @@ import (
var ( var (
// Error defines the gc service errors class. // Error defines the gc service errors class.
Error = errs.Class("gc service error") Error = errs.Class("gc")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -23,7 +23,7 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error wraps errors returned from Server struct methods. // Error wraps errors returned from Server struct methods.
Error = errs.Class("Endpoint error") Error = errs.Class("inspector")
) )
// Endpoint for checking object and segment health. // Endpoint for checking object and segment health.

View File

@ -23,7 +23,7 @@ var (
mon = monkit.Package() mon = monkit.Package()
// Error is a standard error class for this component. // Error is a standard error class for this component.
Error = errs.Class("metainfo loop error") Error = errs.Class("metainfo loop")
// ErrClosed is a loop closed error. // ErrClosed is a loop closed error.
ErrClosed = Error.New("loop closed") ErrClosed = Error.New("loop closed")
) )

View File

@ -18,7 +18,7 @@ import (
var ( var (
// Error defines the expireddeletion chore errors class. // Error defines the expireddeletion chore errors class.
Error = errs.Class("expireddeletion chore error") Error = errs.Class("expired deletion")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -46,9 +46,9 @@ const (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error general metainfo error. // Error general metainfo error.
Error = errs.Class("metainfo error") Error = errs.Class("metainfo")
// ErrNodeAlreadyExists pointer already has a piece for a node err. // ErrNodeAlreadyExists pointer already has a piece for a node err.
ErrNodeAlreadyExists = errs.Class("metainfo error: node already exists") ErrNodeAlreadyExists = errs.Class("metainfo: node already exists")
) )
// APIKeys is api keys store methods used by endpoint. // APIKeys is api keys store methods used by endpoint.

View File

@ -17,7 +17,7 @@ import (
var ( var (
// Error defines the metrics chore errors class. // Error defines the metrics chore errors class.
Error = errs.Class("metrics chore error") Error = errs.Class("metrics")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -75,7 +75,7 @@ type PendingSerial struct {
var ( var (
// Error the default orders errs class. // Error the default orders errs class.
Error = errs.Class("orders error") Error = errs.Class("orders")
// ErrUsingSerialNumber error class for serial number. // ErrUsingSerialNumber error class for serial number.
ErrUsingSerialNumber = errs.Class("serial number") ErrUsingSerialNumber = errs.Class("serial number")

View File

@ -15,7 +15,7 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error represents an overlay error. // Error represents an overlay error.
Error = errs.Class("overlay error") Error = errs.Class("overlay")
) )
// Config is a configuration for overlay service. // Config is a configuration for overlay service.

View File

@ -17,7 +17,7 @@ import (
) )
// Error is error class API errors. // Error is error class API errors.
var Error = errs.Class("coinpayments client error") var Error = errs.Class("coinpayments client")
// ErrMissingPublicKey is returned when Coinpayments client is missing public key. // ErrMissingPublicKey is returned when Coinpayments client is missing public key.
var ErrMissingPublicKey = errs.Class("missing public key") var ErrMissingPublicKey = errs.Class("missing public key")

View File

@ -15,7 +15,7 @@ import (
) )
// ErrChore is stripecoinpayments clearing loop chore error class. // ErrChore is stripecoinpayments clearing loop chore error class.
var ErrChore = errs.Class("stripecoinpayments chore error") var ErrChore = errs.Class("stripecoinpayments chore")
// Chore runs clearing process of reconciling transactions deposits, // Chore runs clearing process of reconciling transactions deposits,
// customer balance, invoices and usages. // customer balance, invoices and usages.

View File

@ -29,7 +29,7 @@ import (
var ( var (
// Error defines stripecoinpayments service error. // Error defines stripecoinpayments service error.
Error = errs.Class("stripecoinpayments service error") Error = errs.Class("stripecoinpayments service")
// ErrNoCouponUsages indicates that there are no coupon usages. // ErrNoCouponUsages indicates that there are no coupon usages.
ErrNoCouponUsages = errs.Class("stripecoinpayments no coupon usages") ErrNoCouponUsages = errs.Class("stripecoinpayments no coupon usages")

View File

@ -14,7 +14,7 @@ import (
) )
// ErrVersion defines version service error. // ErrVersion defines version service error.
var ErrVersion = errs.Class("version service error") var ErrVersion = errs.Class("version service")
// VersionService updates conversion rates in a loop. // VersionService updates conversion rates in a loop.
// //

View File

@ -28,7 +28,7 @@ import (
// Error is a standard error class for this package. // Error is a standard error class for this package.
var ( var (
Error = errs.Class("checker error") Error = errs.Class("repair checker")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -8,4 +8,4 @@ import (
) )
// Error is a standard error class for this package. // Error is a standard error class for this package.
var Error = errs.Class("queue error") var Error = errs.Class("repair queue")

View File

@ -22,7 +22,7 @@ import (
// Error is a standard error class for this package. // Error is a standard error class for this package.
var ( var (
Error = errs.Class("repairer error") Error = errs.Class("repairer")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -26,8 +26,8 @@ import (
) )
var ( var (
metainfoGetError = errs.Class("metainfo db get error") metainfoGetError = errs.Class("metainfo db get")
metainfoPutError = errs.Class("metainfo db put error") metainfoPutError = errs.Class("metainfo db put")
invalidRepairError = errs.Class("invalid repair") invalidRepairError = errs.Class("invalid repair")
overlayQueryError = errs.Class("overlay query failure") overlayQueryError = errs.Class("overlay query failure")
orderLimitFailureError = errs.Class("order limits failure") orderLimitFailureError = errs.Class("order limits failure")

View File

@ -1743,7 +1743,7 @@ func (cache *overlaycache) UpdateCheckIn(ctx context.Context, node overlay.NodeC
var ( var (
// ErrVetting is the error class for the following test methods. // ErrVetting is the error class for the following test methods.
ErrVetting = errs.Class("vetting error") ErrVetting = errs.Class("vetting")
) )
// TestVetNode directly sets a node's vetted_at timestamp to make testing easier. // TestVetNode directly sets a node's vetted_at timestamp to make testing easier.

View File

@ -34,10 +34,10 @@ type DB interface {
} }
// ErrNoDataForPeriod represents errors from the payouts database. // ErrNoDataForPeriod represents errors from the payouts database.
var ErrNoDataForPeriod = errs.Class("no payStub/payments for period error") var ErrNoDataForPeriod = errs.Class("no payStub/payments for period")
// Error is the default error class for payouts package. // Error is the default error class for payouts package.
var Error = errs.Class("payouts db error") var Error = errs.Class("payoutsdb")
// Paystub is an entity that holds held amount of cash that will be paid to storagenode operator after some period. // Paystub is an entity that holds held amount of cash that will be paid to storagenode operator after some period.
type Paystub struct { type Paystub struct {

View File

@ -19,7 +19,7 @@ import (
var mon = monkit.Package() var mon = monkit.Package()
// Error is the default boltdb errs class. // Error is the default boltdb errs class.
var Error = errs.Class("boltdb error") var Error = errs.Class("boltdb")
// Client is the entrypoint into a bolt data store. // Client is the entrypoint into a bolt data store.
type Client struct { type Client struct {

View File

@ -21,7 +21,7 @@ import (
var ( var (
// Error is a redis error. // Error is a redis error.
Error = errs.Class("redis error") Error = errs.Class("redis")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -13,7 +13,7 @@ import (
) )
// ErrNoAPIKey represents no api key error. // ErrNoAPIKey represents no api key error.
var ErrNoAPIKey = errs.Class("no api key error") var ErrNoAPIKey = errs.Class("no api key")
// DB is interface for working with api keys. // DB is interface for working with api keys.
// //

View File

@ -15,7 +15,7 @@ import (
var ( var (
// ErrService defines secret service error. // ErrService defines secret service error.
ErrService = errs.Class("secret service error") ErrService = errs.Class("secret service")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -17,7 +17,7 @@ import (
) )
// ErrNotificationsAPI - console notifications api error type. // ErrNotificationsAPI - console notifications api error type.
var ErrNotificationsAPI = errs.Class("notifications console web error") var ErrNotificationsAPI = errs.Class("consoleapi notifications")
// Notifications is an api controller that exposes all notifications related api. // Notifications is an api controller that exposes all notifications related api.
type Notifications struct { type Notifications struct {

View File

@ -16,7 +16,7 @@ import (
) )
// ErrPayoutAPI - console payouts api error type. // ErrPayoutAPI - console payouts api error type.
var ErrPayoutAPI = errs.Class("payouts console web error") var ErrPayoutAPI = errs.Class("consoleapi payouts")
// Payout is an api controller that exposes all payouts related api. // Payout is an api controller that exposes all payouts related api.
type Payout struct { type Payout struct {

View File

@ -294,7 +294,7 @@ func TestHeldAmountApi(t *testing.T) {
body5, err := ioutil.ReadAll(res5.Body) body5, err := ioutil.ReadAll(res5.Body)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, "{\"error\":\"payouts console web error: wrong period format: period has wrong format\"}\n", string(body5)) require.Equal(t, "{\"error\":\"consoleapi payouts: wrong period format: period has wrong format\"}\n", string(body5))
}) })
t.Run("test AllPayStubsPeriod", func(t *testing.T) { t.Run("test AllPayStubsPeriod", func(t *testing.T) {
@ -350,7 +350,7 @@ func TestHeldAmountApi(t *testing.T) {
body5, err := ioutil.ReadAll(res5.Body) body5, err := ioutil.ReadAll(res5.Body)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, "{\"error\":\"payouts console web error: wrong period format: period has wrong format\"}\n", string(body5)) require.Equal(t, "{\"error\":\"consoleapi payouts: wrong period format: period has wrong format\"}\n", string(body5))
}) })
t.Run("test HeldbackHistory", func(t *testing.T) { t.Run("test HeldbackHistory", func(t *testing.T) {

View File

@ -16,8 +16,8 @@ import (
"storj.io/storj/storagenode/console" "storj.io/storj/storagenode/console"
) )
// ErrStorageNodeAPI - console storageNode api error type. // ErrStorageNodeAPI - console storagenode api error type.
var ErrStorageNodeAPI = errs.Class("storageNode console web error") var ErrStorageNodeAPI = errs.Class("consoleapi storagenode")
// StorageNode is an api controller that exposes all dashboard related api. // StorageNode is an api controller that exposes all dashboard related api.
type StorageNode struct { type StorageNode struct {

View File

@ -26,7 +26,7 @@ import (
var ( var (
mon = monkit.Package() mon = monkit.Package()
// Error is storagenode console web error type. // Error is storagenode console web error type.
Error = errs.Class("storagenode console web error") Error = errs.Class("consoleserver")
) )
// Config contains configuration for storagenode console web server. // Config contains configuration for storagenode console web server.

View File

@ -31,7 +31,7 @@ import (
var ( var (
// SNOServiceErr defines sno service error. // SNOServiceErr defines sno service error.
SNOServiceErr = errs.Class("storage node dashboard service error") SNOServiceErr = errs.Class("console")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -26,7 +26,7 @@ var (
// Error is the default error class for contact package. // Error is the default error class for contact package.
Error = errs.Class("contact") Error = errs.Class("contact")
errPingSatellite = errs.Class("ping satellite error") errPingSatellite = errs.Class("ping satellite")
) )
const initialBackOff = time.Second const initialBackOff = time.Second

View File

@ -22,7 +22,7 @@ import (
var ( var (
// NodeStatsServiceErr defines node stats service error. // NodeStatsServiceErr defines node stats service error.
NodeStatsServiceErr = errs.Class("node stats service error") NodeStatsServiceErr = errs.Class("nodestats")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -23,7 +23,7 @@ import (
var ( var (
// EstimationServiceErr defines sno service error. // EstimationServiceErr defines sno service error.
EstimationServiceErr = errs.Class("storage node estimation payouts service error") EstimationServiceErr = errs.Class("estimationservice")
mon = monkit.Package() mon = monkit.Package()
) )

View File

@ -43,7 +43,7 @@ type DB interface {
} }
// ErrNoPayStubForPeriod represents errors from the payouts database. // ErrNoPayStubForPeriod represents errors from the payouts database.
var ErrNoPayStubForPeriod = errs.Class("no payStub for period error") var ErrNoPayStubForPeriod = errs.Class("no payStub for period")
// PayStub is node payouts data for satellite by specific period. // PayStub is node payouts data for satellite by specific period.
type PayStub struct { type PayStub struct {

View File

@ -25,7 +25,7 @@ import (
var ( var (
// ErrPayoutService defines payout service error. // ErrPayoutService defines payout service error.
ErrPayoutService = errs.Class("payouts service error") ErrPayoutService = errs.Class("payouts service")
// ErrBadPeriod defines that period has wrong format. // ErrBadPeriod defines that period has wrong format.
ErrBadPeriod = errs.Class("wrong period format") ErrBadPeriod = errs.Class("wrong period format")

View File

@ -19,7 +19,7 @@ import (
var ( var (
// ErrSerials defines the usedserials store error class. // ErrSerials defines the usedserials store error class.
ErrSerials = errs.Class("used serials store error") ErrSerials = errs.Class("usedserials")
// ErrSerialAlreadyExists defines an error class for duplicate usedserials. // ErrSerialAlreadyExists defines an error class for duplicate usedserials.
ErrSerialAlreadyExists = errs.Class("used serial already exists in store") ErrSerialAlreadyExists = errs.Class("used serial already exists in store")

View File

@ -18,7 +18,7 @@ import (
var _ apikeys.DB = (*apiKeysDB)(nil) var _ apikeys.DB = (*apiKeysDB)(nil)
// ErrAPIKeysDB represents errors from the api keys database. // ErrAPIKeysDB represents errors from the api keys database.
var ErrAPIKeysDB = errs.Class("apikeys db error") var ErrAPIKeysDB = errs.Class("apikeysdb")
// APIKeysDBName represents the database name. // APIKeysDBName represents the database name.
const APIKeysDBName = "secret" const APIKeysDBName = "secret"

View File

@ -20,7 +20,7 @@ import (
) )
// ErrBandwidth represents errors from the bandwidthdb database. // ErrBandwidth represents errors from the bandwidthdb database.
var ErrBandwidth = errs.Class("bandwidthdb error") var ErrBandwidth = errs.Class("bandwidthdb")
// BandwidthDBName represents the database name. // BandwidthDBName represents the database name.
const BandwidthDBName = "bandwidth" const BandwidthDBName = "bandwidth"

View File

@ -20,7 +20,7 @@ var _ notifications.DB = (*notificationDB)(nil)
const NotificationsDBName = "notifications" const NotificationsDBName = "notifications"
// ErrNotificationsDB represents errors from the notifications database. // ErrNotificationsDB represents errors from the notifications database.
var ErrNotificationsDB = errs.Class("notificationsDB error") var ErrNotificationsDB = errs.Class("notificationsdb")
// notificationDB is an implementation of notifications.Notifications. // notificationDB is an implementation of notifications.Notifications.
// //

View File

@ -19,7 +19,7 @@ import (
) )
// ErrOrders represents errors from the ordersdb database. // ErrOrders represents errors from the ordersdb database.
var ErrOrders = errs.Class("ordersdb error") var ErrOrders = errs.Class("ordersdb")
// OrdersDBName represents the database name. // OrdersDBName represents the database name.
const OrdersDBName = "orders" const OrdersDBName = "orders"

View File

@ -18,7 +18,7 @@ import (
var _ payouts.DB = (*payoutDB)(nil) var _ payouts.DB = (*payoutDB)(nil)
// ErrPayout represents errors from the payouts database. // ErrPayout represents errors from the payouts database.
var ErrPayout = errs.Class("payouts error") var ErrPayout = errs.Class("payouts")
// HeldAmountDBName represents the database name. // HeldAmountDBName represents the database name.
const HeldAmountDBName = "heldamount" const HeldAmountDBName = "heldamount"

View File

@ -14,7 +14,7 @@ import (
) )
// ErrPieceExpiration represents errors from the piece expiration database. // ErrPieceExpiration represents errors from the piece expiration database.
var ErrPieceExpiration = errs.Class("piece expiration error") var ErrPieceExpiration = errs.Class("pieceexpirationdb")
// PieceExpirationDBName represents the database filename. // PieceExpirationDBName represents the database filename.
const PieceExpirationDBName = "piece_expiration" const PieceExpirationDBName = "piece_expiration"

View File

@ -18,7 +18,7 @@ import (
) )
// ErrPieceInfo represents errors from the piece info database. // ErrPieceInfo represents errors from the piece info database.
var ErrPieceInfo = errs.Class("v0pieceinfodb error") var ErrPieceInfo = errs.Class("v0pieceinfodb")
// PieceInfoDBName represents the database name. // PieceInfoDBName represents the database name.
const PieceInfoDBName = "pieceinfo" const PieceInfoDBName = "pieceinfo"

View File

@ -15,7 +15,7 @@ import (
) )
// ErrPieceSpaceUsed represents errors from the piece spaced used database. // ErrPieceSpaceUsed represents errors from the piece spaced used database.
var ErrPieceSpaceUsed = errs.Class("piece space used error") var ErrPieceSpaceUsed = errs.Class("piece space used")
// PieceSpaceUsedDBName represents the database name. // PieceSpaceUsedDBName represents the database name.
const PieceSpaceUsedDBName = "piece_spaced_used" const PieceSpaceUsedDBName = "piece_spaced_used"

View File

@ -18,7 +18,7 @@ import (
var _ pricing.DB = (*pricingDB)(nil) var _ pricing.DB = (*pricingDB)(nil)
// ErrPricing represents errors from the pricing database. // ErrPricing represents errors from the pricing database.
var ErrPricing = errs.Class("pricing error") var ErrPricing = errs.Class("pricing")
// PricingDBName represents the database name. // PricingDBName represents the database name.
const PricingDBName = "pricing" const PricingDBName = "pricing"

View File

@ -16,7 +16,7 @@ import (
) )
// ErrReputation represents errors from the reputation database. // ErrReputation represents errors from the reputation database.
var ErrReputation = errs.Class("reputation error") var ErrReputation = errs.Class("reputation")
// ReputationDBName represents the database name. // ReputationDBName represents the database name.
const ReputationDBName = "reputation" const ReputationDBName = "reputation"

View File

@ -15,7 +15,7 @@ import (
) )
// ErrSatellitesDB represents errors from the satellites database. // ErrSatellitesDB represents errors from the satellites database.
var ErrSatellitesDB = errs.Class("satellitesdb error") var ErrSatellitesDB = errs.Class("satellitesdb")
// SatellitesDBName represents the database name. // SatellitesDBName represents the database name.
const SatellitesDBName = "satellites" const SatellitesDBName = "satellites"

View File

@ -28,7 +28,7 @@ const seedLength = 32
var ( var (
// RolloutErr defines the rollout config error class. // RolloutErr defines the rollout config error class.
RolloutErr = errs.Class("rollout config error") RolloutErr = errs.Class("rollout config")
// EmptySeedErr is used when the rollout contains an empty seed value. // EmptySeedErr is used when the rollout contains an empty seed value.
EmptySeedErr = RolloutErr.New("empty seed") EmptySeedErr = RolloutErr.New("empty seed")
) )