github.com/TIBCOSoftware/flogo-lib@v0.5.9/core/activity/error.go (about) 1 package activity 2 3 // Error is an activity error 4 type Error struct { 5 activityName string 6 errorStr string 7 errorCode string 8 errorData interface{} 9 } 10 11 func NewError(errorText string, code string, errorData interface{}) *Error { 12 return &Error{errorStr: errorText, errorData: errorData, errorCode: code} 13 } 14 15 // Error implements error.Error() 16 func (e *Error) Error() string { 17 return e.errorStr 18 } 19 20 // ActivityName the activity name 21 func (e *Error) ActivityName() string { 22 return e.activityName 23 } 24 25 // Set the activity name 26 func (e *Error) SetActivityName(name string) { 27 e.activityName = name 28 } 29 30 // Data returns any associated error data 31 func (e *Error) Data() interface{} { 32 return e.errorData 33 } 34 35 // Code returns any associated error code 36 func (e *Error) Code() string { 37 return e.errorCode 38 }