Skip to content

Log.Error shouldn't be printing "unhandled" message #666

@bclothier

Description

@bclothier

Given the following minimal repro:

Public Sub Test()
    
    DoCmd.OpenForm "frmVCSMain", , , , , acHidden
    Form_frmVCSMain.StartBuild False
    Log.Clear
    Log.Active = True
    
    On Error GoTo Derp
    
    Debug.Print 1 / 0
    
Dying:
    Log.Flush
    Stop ' check output
    Form_frmVCSMain.FinishBuild False
    Exit Sub
    
Derp:
    Log.Error eelError, "Derp", "Bonk"
    Resume Dying
End Sub

We get:

Image

This is because within the Log.Error, there are calls that eventually reaches LogUnhandledError, particularly modDatabase.VerifyFocus, possibly others.

I'm not 100% sure what is the best resolution. Within the Log.Error routine, it reads from the Err object though I think it should be using a cached copy and then clearing it but there might be other ramifications I'm not considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions