mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
21 lines
340 B
Go
21 lines
340 B
Go
package errors
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
const (
|
|
ErrorPrefixModel = "model"
|
|
ErrorPrefixGrpc = "grpc"
|
|
ErrorPrefixNode = "node"
|
|
ErrorPrefixTask = "task"
|
|
ErrorPrefixUser = "user"
|
|
)
|
|
|
|
type ErrorPrefix string
|
|
|
|
func NewError(prefix ErrorPrefix, msg string) (err error) {
|
|
return errors.New(fmt.Sprintf("%s error: %s", prefix, msg))
|
|
}
|