package util

import (
	"errors"
	"fmt"
	"net/http"
)

type HttpError struct {
	Code    int
	Url     string
	Content string
}

func (e HttpError) Error() string {
	return fmt.Sprintf("%s: %s, %s", http.StatusText(e.Code), e.Url, e.Content)
}

var (
	ErrTestbedConfig = errors.New("TestbedConfig")
	ErrTimeout       = errors.New("Timeout")
)

const (
	// exit code from /usr/include/sysexits.h
	ExitTestbedConfig = 78
	ExitTimeout       = 124 // exitcode of timeout(1)
)
