Closed mlipok closed 1 year ago
this could be done together with: https://github.com/Danp2/au3WebDriver/issues/437
This gets complicated, especially when evaluating for https://github.com/Danp2/au3WebDriver/issues/438#issuecomment-1477734765.
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
?
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
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.
IMHO https://github.com/Danp2/au3WebDriver/pull/448 partialy solves this issue.
but what about: https://github.com/Danp2/au3WebDriver/commit/26565e02cddc575d212d173111ae0d09a93846b6#commitcomment-104723554
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.
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
https://github.com/Danp2/au3WebDriver/commit/26565e02cddc575d212d173111ae0d09a93846b6
https://github.com/Danp2/au3WebDriver/pull/443#issuecomment-1472109904
Describe alternatives you've considered
not related
Additional context
none