Skip to content

function headers in error list needs a review #444

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

Closed
mlipok opened this issue Mar 16, 2023 · 6 comments
Closed

function headers in error list needs a review #444

mlipok opened this issue Mar 16, 2023 · 6 comments

Comments

@mlipok
Copy link
Contributor

mlipok commented Mar 16, 2023

Feature request

Is your feature request related to a problem?

Some funtion headers in error list needs a review.

Describe the solution you'd like

26565e0

#443 (comment)

Describe alternatives you've considered

not related

Additional context

none

@mlipok
Copy link
Contributor Author

mlipok commented Mar 16, 2023

this could be done together with:
#437

@Danp2 Danp2 changed the title funtion headers in error list needs a review function headers in error list needs a review Mar 16, 2023
@Danp2
Copy link
Owner

Danp2 commented Mar 21, 2023

This gets complicated, especially when evaluating for #438 (comment).

Lets take a look at _WD_CreateSession --

  • It is currently documented to set an error code of either $_WD_ERROR_Exception or $_WD_ERROR_SessionNotCreated.

  • It calls __WD_Post, which is documented to set an error code to one of the following values --
    $_WD_ERROR_Exception
    $_WD_ERROR_InvalidValue
    $_WD_ERROR_SendRecv
    $_WD_ERROR_SocketError
    $_WD_ERROR_Timeout

  • __WD_Post calls __WD_DetectError, which can set any of the following error codes --

    $_WD_ERROR_SessionNotCreated
    $_WD_ERROR_SessionInvalid
    $_WD_ERROR_UnknownCommand
    $_WD_ERROR_Timeout
    $_WD_ERROR_NoMatch
    $_WD_ERROR_InvalidArgue
    $_WD_ERROR_ElementIssue
    $_WD_ERROR_NoAlert
    $_WD_ERROR_InvalidExpression
    $_WD_ERROR_Javascript
    $_WD_ERROR_InvalidExpression
    $_WD_ERROR_ContextInvalid
    $_WD_ERROR_Exception

So which of these should be listed in the function header of _WD_CreateSession?

@mlipok
Copy link
Contributor Author

mlipok commented Mar 23, 2023

Intention to create this issue was only reminder to check new features $_WD_ErrorShadowRootNotFound and $_WD_ErrorFrameNotFound in order to suplement in related function headers with information about $_WD_ERROR_NoMatch

@Danp2
Copy link
Owner

Danp2 commented Mar 23, 2023

These $_WD_Error constants are only used in __WD_DetectError, so perhaps they should be move / changed to local constants?

in order to suplement in related function headers with information about $_WD_ERROR_NoMatch

Not sure what you mean here.

@Danp2 Danp2 mentioned this issue Mar 25, 2023
9 tasks
@mlipok
Copy link
Contributor Author

mlipok commented Apr 4, 2023

IMHO #448 partialy solves this issue.

but what about:
26565e0#commitcomment-104723554

@Danp2
Copy link
Owner

Danp2 commented Apr 4, 2023

I think #448 made this issue more complex as I attempted to describe above. FWIW, it wasn't clear when you opened this issue that it was only intended to address the most recently added error codes from __WD_DetectError.

I believe that I already mentioned that I intend to open an new issue on this topic with the hope of achieving a standard method of documenting errors for all existing functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants