github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/remote/errors.go (about) 1 package remote 2 3 var ( 4 ErrUnAvailable = &ResponseError{ResponseStatusCodeUNAVAILABLE} 5 ErrTimeout = &ResponseError{ResponseStatusCodeTIMEOUT} 6 ErrProcessNameAlreadyExist = &ResponseError{ResponseStatusCodePROCESSNAMEALREADYEXIST} 7 ErrDeadLetter = &ResponseError{ResponseStatusCodeDeadLetter} 8 ErrUnknownError = &ResponseError{ResponseStatusCodeERROR} 9 ) 10 11 // ResponseError is an error type. 12 // e.g.: 13 // 14 // var err = &ResponseError{1} 15 type ResponseError struct { 16 Code ResponseStatusCode 17 } 18 19 func (r *ResponseError) Error() string { 20 if r == nil { 21 return "nil" 22 } 23 24 return r.Code.String() 25 }