🌈 The replace! method fails if the flag is not found OR if the text is already present. The error message only says that the flag has not been found. This is incorrect/misleading in the case where it has actually failed because the content is already present. This is pr just adds that to the error message.
Alternatively, could add a separate error message, change the return value from replace! to indicate the type of error but this seems like overkill.
🌈 The
replace!
method fails if the flag is not found OR if the text is already present. The error message only says that the flag has not been found. This is incorrect/misleading in the case where it has actually failed because the content is already present. This is pr just adds that to the error message.Alternatively, could add a separate error message, change the return value from
replace!
to indicate the type of error but this seems like overkill.