func ServiceAlreadyBound(service string) APIError {
	return NewAPIError(
		fmt.Sprintf("Service '%s' already bound", service),
		"",
		http.StatusConflict)
}
ServiceAlreadyBound constructs an API error for when the service to bind is already bound to the app
package errors
import (
	"fmt"
	"net/http"
	"strings"
)
type ErrorResponse struct {
	Errors []APIError `json:"errors"`
}
type APIErrors interface {
	Errors() []APIError
	FirstStatus() int
}
type APIError struct {
	Status  int    `json:"status"`
	Title   string `json:"title"`
	Details string `json:"details"`
}
var _ APIErrors = APIError{}
var _ error = APIError{}
func (a APIError) Error() string {
	return a.Title
}
func (a APIError) Errors() []APIError {
	return []APIError{a}
}
func (a APIError) FirstStatus() int {
	return a.Status
}
func NewAPIError(title string, details string, status int) APIError {
	return APIError{
		Title:   title,
		Details: details,
		Status:  status,
	}
}
type MultiError struct {
	errors []APIError
}
var _ APIErrors = MultiError{}
var _ error = MultiError{}
func (m MultiError) Error() string {
	return m.errors[0].Title
}
func (m MultiError) Errors() []APIError {
	return m.errors
}
func (m MultiError) FirstStatus() int {
	return m.errors[0].Status
}
func NewMultiError(errs []APIError) MultiError {
	return MultiError{errors: errs}
}
func InternalError(err error, details ...string) APIError {
	return NewAPIError(
		err.Error(),
		strings.Join(details, ", ")+fmt.Sprintf("\nServer Backtrace: %+v", err),
		http.StatusInternalServerError,
	)
}
func NewInternalError(msg string, details ...string) APIError {
	return NewAPIError(msg, strings.Join(details, ", "), http.StatusInternalServerError)
}
func BadRequest(err error, details ...string) APIError {
	return NewAPIError(err.Error(), strings.Join(details, ", "), http.StatusBadRequest)
}
func NewBadRequest(msg string, details ...string) APIError {
	return NewAPIError(msg, strings.Join(details, ", "), http.StatusBadRequest)
}
func NewNotFoundError(msg string, details ...string) APIError {
	return NewAPIError(msg, strings.Join(details, ", "), http.StatusNotFound)
}
func UserNotFound() APIError {
	return NewAPIError(
		"User not found in the request header",
		"",
		http.StatusBadRequest)
}
func OrgIsNotKnown(org string) APIError {
	return NewAPIError(
		fmt.Sprintf("Targeted namespace '%s' does not exist", org),
		"",
		http.StatusNotFound)
}
func AppAlreadyKnown(app string) APIError {
	return NewAPIError(
		fmt.Sprintf("Application '%s' already exists", app),
		"",
		http.StatusConflict)
}
func AppIsNotKnown(app string) APIError {
	return NewAPIError(
		fmt.Sprintf("Application '%s' does not exist", app),
		"",
		http.StatusNotFound)
}
func ServiceIsNotKnown(service string) APIError {
	return NewAPIError(
		fmt.Sprintf("Service '%s' does not exist", service),
		"",
		http.StatusNotFound)
}
func OrgAlreadyKnown(org string) APIError {
	return NewAPIError(
		fmt.Sprintf("Namespace '%s' already exists", org),
		"",
		http.StatusConflict)
}
func ServiceAlreadyKnown(service string) APIError {
	return NewAPIError(
		fmt.Sprintf("Service '%s' already exists", service),
		"",
		http.StatusConflict)
}