func (e *TimeoutError) HasDetails() bool {
	return e.details != nil && e.details.HasValues()
}
HasDetails return if this error has strong typed detail data.
package internal
import (
	"errors"
	"fmt"
	"reflect"
	"strings"
	"go.uber.org/cadence/.gen/go/shared"
)
type (
	CustomError struct {
		reason  string
		details Values
	}
	GenericError struct {
		err string
	}
	TimeoutError struct {
		timeoutType shared.TimeoutType
		details     Values
	}
	CanceledError struct {
		details Values
	}
	TerminatedError struct {
	}
	PanicError struct {
		value      interface{}
		stackTrace string
	}
	workflowPanicError struct {
		value      interface{}
		stackTrace string
	}
	ContinueAsNewError struct {
		wfn    interface{}
		args   []interface{}
		params *executeWorkflowParams
	}
	UnknownExternalWorkflowExecutionError struct{}
	ErrorDetailsValues []interface{}
)
const (
	errReasonPanic    = "cadenceInternal:Panic"
	errReasonGeneric  = "cadenceInternal:Generic"
	errReasonCanceled = "cadenceInternal:Canceled"
	errReasonTimeout  = "cadenceInternal:Timeout"
)
var ErrNoData = errors.New("no data available")
var ErrTooManyArg = errors.New("too many arguments")
var ErrActivityResultPending = errors.New("not error: do not autocomplete, using Client.CompleteActivity() to complete")
func NewCustomError(reason string, details ...interface{}) *CustomError {
	if strings.HasPrefix(reason, "cadenceInternal:") {
		panic("'cadenceInternal:' is reserved prefix, please use different reason")
	}
	if len(details) == 1 {
		if d, ok := details[0].(*EncodedValues); ok {
			return &CustomError{reason: reason, details: d}
		}
	}
	return &CustomError{reason: reason, details: ErrorDetailsValues(details)}
}
func NewTimeoutError(timeoutType shared.TimeoutType, details ...interface{}) *TimeoutError {
	if len(details) == 1 {
		if d, ok := details[0].(*EncodedValues); ok {
			return &TimeoutError{timeoutType: timeoutType, details: d}
		}
	}
	return &TimeoutError{timeoutType: timeoutType, details: ErrorDetailsValues(details)}
}
func NewHeartbeatTimeoutError(details ...interface{}) *TimeoutError {
	return NewTimeoutError(shared.TimeoutTypeHeartbeat, details...)
}
func NewCanceledError(details ...interface{}) *CanceledError {
	if len(details) == 1 {
		if d, ok := details[0].(*EncodedValues); ok {
			return &CanceledError{details: d}
		}
	}
	return &CanceledError{details: ErrorDetailsValues(details)}
}
func IsCanceledError(err error) bool {
	_, ok := err.(*CanceledError)
	return ok
}
func NewContinueAsNewError(ctx Context, wfn interface{}, args ...interface{}) *ContinueAsNewError {
	options := getWorkflowEnvOptions(ctx)
	if options == nil {
		panic("context is missing required options for continue as new")
	}
	env := getWorkflowEnvironment(ctx)
	workflowType, input, err := getValidatedWorkflowFunction(wfn, args, options.dataConverter, env.GetRegistry())
	if err != nil {
		panic(err)
	}
	if options.taskListName == nil || *options.taskListName == "" {
		panic("invalid task list provided")
	}
	if options.executionStartToCloseTimeoutSeconds == nil || *options.executionStartToCloseTimeoutSeconds <= 0 {
		panic("invalid executionStartToCloseTimeoutSeconds provided")
	}
	if options.taskStartToCloseTimeoutSeconds == nil || *options.taskStartToCloseTimeoutSeconds <= 0 {
		panic("invalid taskStartToCloseTimeoutSeconds provided")
	}
	params := &executeWorkflowParams{
		workflowOptions: *options,
		workflowType:    workflowType,
		input:           input,
		header:          getWorkflowHeader(ctx, options.contextPropagators),
	}
	return &ContinueAsNewError{wfn: wfn, args: args, params: params}
}
func (e *CustomError) Error() string {
	return e.reason
}
func (e *CustomError) Reason() string {
	return e.reason
}
func (e *CustomError) HasDetails() bool {
	return e.details != nil && e.details.HasValues()
}
func (e *CustomError) Details(d ...interface{}) error {
	if !e.HasDetails() {
		return ErrNoData
	}
	return e.details.Get(d...)
}
func (e *GenericError) Error() string {
	return e.err
}
func (e *TimeoutError) Error() string {
	return fmt.Sprintf("TimeoutType: %v", e.timeoutType)
}
func (e *TimeoutError) TimeoutType() shared.TimeoutType {
	return e.timeoutType
}