Skip to content

Commit

Permalink
expose query timeout error to result set (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhaocs authored Oct 9, 2024
1 parent fe239fa commit 71af1fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions result_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const (
ErrorCode_E_BAD_PERMISSION ErrorCode = ErrorCode(nebula.ErrorCode_E_BAD_PERMISSION)
ErrorCode_E_SEMANTIC_ERROR ErrorCode = ErrorCode(nebula.ErrorCode_E_SEMANTIC_ERROR)
ErrorCode_E_PARTIAL_SUCCEEDED ErrorCode = ErrorCode(nebula.ErrorCode_E_PARTIAL_SUCCEEDED)
ErrorCode_E_QUERY_TIMEDOUT ErrorCode = ErrorCode(nebula.ErrorCode_E_QUERY_TIMEDOUT)
)

func GenResultSet(resp *graph.ExecutionResponse) (*ResultSet, error) {
Expand Down Expand Up @@ -486,6 +487,10 @@ func (res ResultSet) IsPartialSucceed() bool {
return res.GetErrorCode() == ErrorCode_E_PARTIAL_SUCCEEDED
}

func (res ResultSet) IsQueryTimeout() bool {
return res.GetErrorCode() == ErrorCode_E_QUERY_TIMEDOUT
}

func (res ResultSet) hasColName(colName string) bool {
if _, ok := res.colNameIndexMap[colName]; ok {
return true
Expand Down

0 comments on commit 71af1fa

Please sign in to comment.