Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Err.Description doesn't make it through to a compiled DLL #464

Closed
Greedquest opened this issue Oct 8, 2021 · 3 comments
Closed

Err.Description doesn't make it through to a compiled DLL #464

Greedquest opened this issue Oct 8, 2021 · 3 comments
Labels
bug Something isn't working confirmed the issue has been verified

Comments

@Greedquest
Copy link

Greedquest commented Oct 8, 2021

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Public Class Foo
    Public Sub t()
        Err.Raise vbObjectError + 5, Description:="No project found with that name"
    End Sub
End Class

Expected behavior
Called from tB we get

image

as expected.

In VBA we get:
image

... which is the default message for that error number Error$(vbObjectError + 5)

Desktop (please complete the following information):

  • Version: 0.10.5788
  • Win 10
@WaynePhillipsEA
Copy link
Collaborator

Thanks for reporting. There's a little bit of work to be done on error handling in #56 soon, and so this will be remedied at that point.

@WaynePhillipsEA WaynePhillipsEA added bug Something isn't working confirmed the issue has been verified labels Oct 16, 2021
@GCuser99
Copy link

GCuser99 commented Jun 15, 2023

I'll just add that when I compile the below into an ActiveX DLL (v334), calling the TestErrChild() does raise the error properly, but calling it indirectly through TestErrParent() returns incorrect function for the error description.

'both of these procedures are in the same class module
Public Sub TestErrParent() 
    Call TestErrChild 'error description displays "incorrect function"
End Sub

Public Sub TestErrChild()
    Err.Raise 1, "somewhere", "error raised in child sub" 
End Sub

Also, if TestErrChild() is rejiggered into a function instead of a sub, running TestErrParent() does not raise ANY error, and returns False in the MsgBox:

'both of these procedures are in the same class module
Public Sub TestErrParent()
    MsgBox TestErrChild() 'no error is raised and this displays "False"
End Sub

Public Function TestErrChild() As Boolean
    Err.Raise 1, "somewhere", "error raised in child function" 
    TestErrChild = True
End Function

Thanks!

EDIT: Further to above... I edited my original post to indicate that the parent and child procedures above all lived in a class module. But if I move the child procedures to a standard module, while leaving the parent (caller) procedures in the class module, all works as expected!

GCuser99 added a commit to GCuser99/SeleniumVBA that referenced this issue Jun 20, 2023
Added ExecuteCDP method to WebDriver class to expose Chrome DevTools Protocol methods for browser automation
Added ExecuteCmd method to WebDriver class to facilitate testing of new/unwrapped Selenium WebDriver commands
Added SaveBase64StringToFile, and ResolvePath helper methods for above to WebDriver class
Added GetElementId helper method for above to WebDriver and WebElement classes
Added SendAlert method to WebDriver class
Refactored execute procedure of WebDriver class for improved clarity and error handling:
	- Added optional receiveTimeout input argument
	- Moved OpenBrowser-specific error handling to OpenBrowser method
	- Added code to handle non-standard Selenium and server communication errors
	- Added clientStatus error code to response package for caller error handling
Added implicit wait, page load timeout, and script timeout default parameters to SeleniumVBA ini file
Added globals to WebDriver class to track timeout settings for avoiding unnecessary calls to Selenium WebDriver
Extended OpenBrowser receiveTimeout from 3 secs to 10 secs to accomodate slower computers
Added optional arguments to NavigateToFile method of WebDriver class to align with same in NavigateTo method
Added file-exits check to NavigateToFile method of WebDriver class
Modified DefaultIOfolder get property of WebDriver class to return the default path
Added full screenshot option to SaveScreenshot method of WebDriver class
Added SetGeolocationAware method to WebCapabilities class to turn on/off browser geolocation
Added CtrlShiftKey method to WebActionChain class
Added test_ExecuteCmd and test_ExcuteCDP standard modules
Removed test_UserAgent standard module
Added more test procedures to test_ExecuteScript, test_Wait, test_IsPresent and others
Minor code mods and cleanup
Designed DLL work-around for twinBASIC Err.Raise issue twinbasic/twinbasic#464
Updated Help and Object model pages in Wiki, and SeleniumVBA Readme file
@WaynePhillipsEA
Copy link
Collaborator

Fixed in BETA 411. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed the issue has been verified
Projects
None yet
Development

No branches or pull requests

3 participants