This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move constant error to internal package - Remove spew.Dump from tests Signed-off-by: Evgeniy Kulikov <[email protected]>
- Loading branch information
1 parent
3f4d010
commit bf16d75
Showing
6 changed files
with
20 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package internal | ||
|
||
// Error constant type error | ||
type Error string | ||
|
||
// Error returns error message as string | ||
func (e Error) Error() string { return string(e) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
package workers | ||
|
||
// Error is constant error | ||
type Error string | ||
import "github.com/im-kulikov/helium/internal" | ||
|
||
const ( | ||
// ErrMissingKey when config key for worker is missing | ||
ErrMissingKey = Error("missing worker key") | ||
ErrMissingKey = internal.Error("missing worker key") | ||
|
||
// ErrEmptyConfig when viper not passed to params | ||
ErrEmptyConfig = Error("empty config") | ||
ErrEmptyConfig = internal.Error("empty config") | ||
|
||
// ErrEmptyWorkers when workers not passed to params | ||
ErrEmptyWorkers = Error("empty workers") | ||
ErrEmptyWorkers = internal.Error("empty workers") | ||
|
||
// ErrEmptyLocker when locker required, | ||
// but not passed to params | ||
ErrEmptyLocker = Error("empty locker") | ||
ErrEmptyLocker = internal.Error("empty locker") | ||
|
||
// ErrEmptyJob when worker job is nil | ||
ErrEmptyJob = Error("empty job") | ||
ErrEmptyJob = internal.Error("empty job") | ||
) | ||
|
||
// Error converts constant error from string | ||
func (e Error) Error() string { | ||
return string(e) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters