17 lines
331 B
Go
17 lines
331 B
Go
|
// Copyright (c) Mainflux
|
||
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
|
||
|
package sdk_test
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/mainflux/mainflux/errors"
|
||
|
)
|
||
|
|
||
|
func createError(e error, statusCode int) error {
|
||
|
httpStatus := fmt.Sprintf("%d %s", statusCode, http.StatusText(statusCode))
|
||
|
return errors.Wrap(e, errors.New(httpStatus))
|
||
|
}
|