diff --git a/gapis/api/cmd_errors.go b/gapis/api/cmd_errors.go index 0b386a7332..b9ec688fc3 100644 --- a/gapis/api/cmd_errors.go +++ b/gapis/api/cmd_errors.go @@ -32,6 +32,6 @@ func Abort(msg string) *ErrCmdAborted { // IsErrCmdAborted returns true if the cause of the error err was due to an // abort() in the command. func IsErrCmdAborted(err error) bool { - _, ok := errors.Cause(err).(ErrCmdAborted) + _, ok := errors.Cause(err).(*ErrCmdAborted) return ok } diff --git a/gapis/api/gles/find_issues.go b/gapis/api/gles/find_issues.go index ab85ef237c..302194f605 100644 --- a/gapis/api/gles/find_issues.go +++ b/gapis/api/gles/find_issues.go @@ -93,13 +93,6 @@ func (t *findIssues) Transform(ctx context.Context, id api.CmdID, cmd api.Cmd, o cb := CommandBuilder{Thread: cmd.Thread()} t.lastGlError = GLenum_GL_NO_ERROR mutateErr := cmd.Mutate(ctx, id, t.state, nil /* no builder */) - if mutateErr != nil { - if api.IsErrCmdAborted(mutateErr) && t.lastGlError != GLenum_GL_NO_ERROR { - // GL errors have already been reported - so do not log it again. - } else { - t.onIssue(cmd, id, service.Severity_ErrorLevel, mutateErr) - } - } mutatorsGlError := t.lastGlError if e := FindErrorState(cmd.Extras()); e != nil { diff --git a/gapis/api/gles/gles.go b/gapis/api/gles/gles.go index c4b19534c0..0f8a6845de 100644 --- a/gapis/api/gles/gles.go +++ b/gapis/api/gles/gles.go @@ -44,7 +44,7 @@ func (c *State) preMutate(ctx context.Context, s *api.State, cmd api.Cmd) error if f := s.NewMessage; f != nil { f(log.Error, messages.ErrNoContextBound(cmd.Thread())) } - return api.ErrCmdAborted{Reason: "No context bound"} + return &api.ErrCmdAborted{Reason: "No context bound"} } return nil } diff --git a/gapis/messages/en-us.stb.md b/gapis/messages/en-us.stb.md index 3fa2d8adbe..881295adbb 100644 --- a/gapis/messages/en-us.stb.md +++ b/gapis/messages/en-us.stb.md @@ -115,6 +115,10 @@ Internal error in trace assert: {{reason}} {{error}} +# ERR_INTERNAL_ERROR + +Internal error: {{error}} + # ERR_REPLAY_DRIVER Error during replay: {{replayError}} diff --git a/gapis/resolve/report.go b/gapis/resolve/report.go index a9d961a0fa..f0ddda1bb2 100644 --- a/gapis/resolve/report.go +++ b/gapis/resolve/report.go @@ -16,7 +16,6 @@ package resolve import ( "context" - "fmt" "github.com/google/gapid/core/log" "github.com/google/gapid/gapis/api" @@ -70,13 +69,9 @@ func (r *ReportResolvable) Resolve(ctx context.Context) (interface{}, error) { builder := service.NewReportBuilder() - var lastError interface{} var currentAtom uint64 items := []*service.ReportItemRaw{} state := c.NewState() - state.OnError = func(err interface{}) { - lastError = err - } state.NewMessage = func(s log.Severity, m *stringtable.Msg) uint32 { items = append(items, r.newReportItem(s, currentAtom, m)) return uint32(len(items) - 1) @@ -122,22 +117,17 @@ func (r *ReportResolvable) Resolve(ctx context.Context) (interface{}, error) { // Gather report items from the state mutator, and collect together all the // APIs in use. api.ForeachCmd(ctx, c.Commands, func(ctx context.Context, id api.CmdID, cmd api.Cmd) error { - items, lastError, currentAtom = items[:0], nil, uint64(id) + items, currentAtom = items[:0], uint64(id) if as := cmd.Extras().Aborted(); as != nil && as.IsAssert { items = append(items, r.newReportItem(log.Fatal, uint64(id), messages.ErrTraceAssert(as.Reason))) } - err := cmd.Mutate(ctx, id, state, nil /* no builder, just mutate */) - - if len(items) == 0 { - if err != nil && !api.IsErrCmdAborted(err) { - items = append(items, r.newReportItem(log.Error, uint64(id), - messages.ErrMessage(err))) - } else if lastError != nil { + if err := cmd.Mutate(ctx, id, state, nil /* no builder, just mutate */); err != nil { + if !api.IsErrCmdAborted(err) { items = append(items, r.newReportItem(log.Error, uint64(id), - messages.ErrMessage(fmt.Sprintf("%v", lastError)))) + messages.ErrInternalError(err.Error()))) } }