File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,24 @@ func ClientHTTPStatusAndError(err error) (int, error) {
7272 return http .StatusGatewayTimeout , errors .New (ErrDeadlineExceeded )
7373 }
7474
75+ // Return 400 if any of the errors in the MultiError are client errors (4xx)
76+ if ok {
77+ for _ , e := range me {
78+ if errors .As (e , & queryErr ) ||
79+ errors .Is (e , logqlmodel .ErrLimit ) ||
80+ errors .Is (e , logqlmodel .ErrParse ) ||
81+ errors .Is (e , logqlmodel .ErrPipeline ) ||
82+ errors .Is (e , logqlmodel .ErrBlocked ) ||
83+ errors .Is (e , logqlmodel .ErrParseMatchers ) ||
84+ errors .Is (e , logqlmodel .ErrUnsupportedSyntaxForInstantQuery ) ||
85+ errors .Is (e , user .ErrNoOrgID ) ||
86+ errors .As (e , & userErr ) ||
87+ errors .Is (e , logqlmodel .ErrVariantsDisabled ) {
88+ return http .StatusBadRequest , err
89+ }
90+ }
91+ }
92+
7593 if s , isRPC := status .FromError (err ); isRPC {
7694 if s .Code () == codes .DeadlineExceeded {
7795 return http .StatusGatewayTimeout , errors .New (ErrDeadlineExceeded )
You can’t perform that action at this time.
0 commit comments