Skip to content

Commit

Permalink
feat(summarize): add request id to error message for tracking (#883)
Browse files Browse the repository at this point in the history
Merged by Reviewpad
  • Loading branch information
marcelosousa committed May 17, 2023
1 parent 14d4ddd commit 027e325
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/aladino/actions/robinSummarize.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
api "github.com/reviewpad/api/go/services"
converter "github.com/reviewpad/go-lib/converters"
"github.com/reviewpad/go-lib/entities"
lib_http "github.com/reviewpad/go-lib/http"
"github.com/reviewpad/reviewpad/v4/lang/aladino"
plugins_aladino_services "github.com/reviewpad/reviewpad/v4/plugins/aladino/services"
)
Expand Down Expand Up @@ -54,7 +55,7 @@ func robinSummarizeCode(e aladino.Env, args []aladino.Value) error {
resp, err := robinClient.Summarize(e.GetCtx(), req)
if err != nil {
log.Infof("summarize failed with %v", err)
return fmt.Errorf("summarize failed - please contact us on [Discord](https://reviewpad.com/discord)")
return fmt.Errorf("summarize failed on request %v - please contact us on [Discord](https://reviewpad.com/discord)", lib_http.InRequestID(e.GetCtx()))
}

return target.Comment(fmt.Sprintf("**AI-Generated Summary**: %s", resp.Summary))
Expand Down

0 comments on commit 027e325

Please sign in to comment.