Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(README): adjust README reconnectOnError code sample (#1089)
The existing README code sample checks for an error message that begins with the string READONLY however if the error is produced from a lua script the condition would not match it. A lua script READONLY error looks like this: ERR Error running script (call to f_45e87c07f6aff394093b73766a458691d0460655): @user_script:1: @user_script: 1: -READONLY You can't write against a read only replica. This changes the sample to instead check for READONLY as a substring
- Loading branch information
e22cae6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luin would
String.startWiths
better here and same as the old logic?https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
e22cae6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my bad. Didn't see the PR