Skip to content

Commit 596a641

Browse files
committed
add warns to session on uast functions
Signed-off-by: Miguel Molina <[email protected]>
1 parent 1877041 commit 596a641

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

internal/function/uast.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ func (u *uastFunc) Eval(ctx *sql.Context, row sql.Row) (out interface{}, err err
185185
"This can be configured using %s environment variable",
186186
uastMaxBlobSizeKey,
187187
)
188+
189+
ctx.Warn(
190+
0,
191+
"uast will be skipped, file is too big to send to bblfsh."+
192+
"This can be configured using %s environment variable",
193+
uastMaxBlobSizeKey,
194+
)
188195
return nil, nil
189196
}
190197

internal/function/uast_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func getUASTFromBblfsh(ctx *sql.Context,
115115
if err != nil {
116116
err := ErrParseBlob.New(err)
117117
logrus.Warn(err)
118+
ctx.Warn(0, err.Error())
118119
return nil, err
119120
}
120121

0 commit comments

Comments
 (0)