You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If $prompt is set to an empty string ("") and $promptError is set as non-empty (eg. "ERROR") then any error condition is never detected.
Using the example from the README, this is what would happen:
Graze\TelnetClient\TelnetResponse {#188#isError: false#responseText: "I'm sorry, Dave. I'm afraid I can't do that\nERROR"#promptMatches: array:1 [0 => ""
]
}
The reason that this happens is that prompt checking (getResponse() in Graze\TelnetClient\TelnetClient) happens before error checking. In the case of an empty prompt it always matches and so the error prompt check never happens.
Some thoughts on fixes:
Change the ordering such that error prompt checking happens first.
Don't attempt any matching if a prompt is an empty string
The text was updated successfully, but these errors were encountered:
If
$prompt
is set to an empty string (""
) and$promptError
is set as non-empty (eg."ERROR"
) then any error condition is never detected.Using the example from the README, this is what would happen:
The reason that this happens is that prompt checking (
getResponse()
inGraze\TelnetClient\TelnetClient
) happens before error checking. In the case of an empty prompt it always matches and so the error prompt check never happens.Some thoughts on fixes:
The text was updated successfully, but these errors were encountered: