2019-09-04 16:02:39 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package consoleql
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zeebo/errs"
|
|
|
|
|
|
|
|
"storj.io/storj/satellite/console"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Error messages
|
|
|
|
const (
|
|
|
|
internalErrDetailedMsg = "It looks like we had a problem on our end. Please try again"
|
|
|
|
)
|
|
|
|
|
|
|
|
// errConsoleInternalDetailed describes detailed error message for internal error
|
|
|
|
var errConsoleInternalDetailed = errs.New(internalErrDetailedMsg)
|
|
|
|
|
|
|
|
// HandleError returns detailed error if such error handles
|
|
|
|
func HandleError(err error) error {
|
|
|
|
switch {
|
2019-11-12 13:14:31 +00:00
|
|
|
case console.Error.Has(err):
|
2019-09-04 16:02:39 +01:00
|
|
|
return errConsoleInternalDetailed
|
|
|
|
default:
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|