feat: initial commit
This commit is contained in:
25
internal/domain/apperror/errors.go
Normal file
25
internal/domain/apperror/errors.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package apperror
|
||||
|
||||
import "errors"
|
||||
|
||||
type AppError struct {
|
||||
Code string
|
||||
Message string
|
||||
}
|
||||
|
||||
func (e *AppError) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
var (
|
||||
ErrMessageEmpty = &AppError{Code: "MSG_EMPTY", Message: "message text is empty"}
|
||||
ErrRouteNotFound = &AppError{Code: "ROUTE_NOT_FOUND", Message: "no route found for message"}
|
||||
ErrWorkflowTimeout = &AppError{Code: "WORKFLOW_TIMEOUT", Message: "workflow call timed out"}
|
||||
ErrTranscriptionFailed = &AppError{Code: "TRANSCRIPTION_FAILED", Message: "voice transcription failed"}
|
||||
ErrSessionNotFound = &AppError{Code: "SESSION_NOT_FOUND", Message: "session not found"}
|
||||
ErrDownloadFailed = &AppError{Code: "DOWNLOAD_FAILED", Message: "file download failed"}
|
||||
)
|
||||
|
||||
func Is(err, target error) bool {
|
||||
return errors.Is(err, target)
|
||||
}
|
||||
Reference in New Issue
Block a user