package models import "errors" // Application errors var ( // ErrNotFound resource not found ErrNotFound = errors.New("resource not found") // ErrAlreadyExists resource already exists ErrAlreadyExists = errors.New("resource already exists") // ErrValidationFailed validation failed ErrValidationFailed = errors.New("validation failed") // ErrUnauthorized unauthorized access ErrUnauthorized = errors.New("unauthorized access") // ErrForbidden forbidden access ErrForbidden = errors.New("forbidden access") // ErrInternalServer internal server error ErrInternalServer = errors.New("internal server error") // ErrConnectionFailed connection failed ErrConnectionFailed = errors.New("connection failed") // ErrQueryFailed query execution failed ErrQueryFailed = errors.New("query execution failed") // ErrEncryptionFailed encryption/decryption failed ErrEncryptionFailed = errors.New("encryption/decryption failed") // ErrInvalidConfig invalid configuration ErrInvalidConfig = errors.New("invalid configuration") // ErrDatabaseLocked database is locked ErrDatabaseLocked = errors.New("database is locked") // ErrTimeout operation timeout ErrTimeout = errors.New("operation timeout") ) // ErrorCode represents error codes for API responses type ErrorCode string const ( // CodeSuccess successful operation CodeSuccess ErrorCode = "SUCCESS" // CodeNotFound resource not found CodeNotFound ErrorCode = "NOT_FOUND" // CodeValidation validation error CodeValidation ErrorCode = "VALIDATION_ERROR" // CodeUnauthorized unauthorized CodeUnauthorized ErrorCode = "UNAUTHORIZED" // CodeForbidden forbidden CodeForbidden ErrorCode = "FORBIDDEN" // CodeInternal internal error CodeInternal ErrorCode = "INTERNAL_ERROR" // CodeConnection connection error CodeConnection ErrorCode = "CONNECTION_ERROR" // CodeQuery query error CodeQuery ErrorCode = "QUERY_ERROR" // CodeEncryption encryption error CodeEncryption ErrorCode = "ENCRYPTION_ERROR" )