Where in the error message would this newline be, when are newlines contained in error messages, please provide more info, this seems like a larger issue.
Where in the error message would this newline be, when are newlines contained in error messages, please provide more info, this seems like a larger issue.
with using mysql,this may case the error: user.create({ name: 'john\r' }); user.create({ name: 'john\r' });
(if name is unique)
the error code is 1062,and the match() just return null.
In this case your fix is not sufficient.
There are many occurrences where err.message is matched via regex and .replace(string, string) only replaces a single occurrences, my suggestion is you add a util method called removeNewlines(str) { return str.replace(/[\r\n]/g, ''); and apply it to all of them.
In this case your fix is not sufficient.
There are many occurrences where err.message is matched via regex and .replace(string, string) only replaces a single occurrences, my suggestion is you add a util method called removeNewlines(str) { return str.replace(/[\r\n]/g, ''); and apply it to all of them.
do you think that is a good idea to change (.*)
to ([\s\S]*)
when match err.message?
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
You can’t perform that action at this time.
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.
Pull Request check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
as this issue
#6725
when get a \r in the err.message,match() will return null