Skip to content

Commit

Permalink
Adds some logging around crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
brotherlogic committed Aug 6, 2020
1 parent 9a44cba commit 155fa3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion goserverapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,9 @@ func (s *GoServer) BounceIssue(title, body string, job string) {
//SendCrash reports a crash
func (s *GoServer) SendCrash(ctx context.Context, crashText string, ctype pbbs.Crash_CrashType) {
conn, err := s.FDialServer(ctx, "buildserver")
if err != nil {
s.Log(fmt.Sprintf("Unable to dial buildserver: %v", err))
}
if err == nil {
defer conn.Close()
client := pbbs.NewBuildServiceClient(conn)
Expand All @@ -1322,7 +1325,7 @@ func (s *GoServer) SendCrash(ctx context.Context, crashText string, ctype pbbs.C
infoString += fmt.Sprintf("%v = %v\n", str.Key, str)
}

client.ReportCrash(ctx, &pbbs.CrashRequest{
_, err := client.ReportCrash(ctx, &pbbs.CrashRequest{
Version: s.RunningFile,
Origin: s.Registry.Name,
Job: &pbgbs.Job{
Expand All @@ -1331,6 +1334,7 @@ func (s *GoServer) SendCrash(ctx context.Context, crashText string, ctype pbbs.C
Crash: &pbbs.Crash{
ErrorMessage: crashText + "\n" + infoString,
CrashType: ctype}})
s.Log(fmt.Sprintf("Reported crash: %v", err))
}
}

Expand Down

0 comments on commit 155fa3b

Please sign in to comment.