question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chaining check causes duplicated errors

See original GitHub issue

request.check('email', 'Email is not valid').notEmpty().notNull().isEmail();

With no “email” field set this will return 3 repeatitions of the same message. Shouldn’t the error message be unified on chained call like this?

Thank you

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gustavohenkecommented, Nov 24, 2016

Hi everyone! The fix for this has finally landed in v3.0.0!

req.getValidationResult().then( result => {
  var errors = result.useFirstErrorOnly().array(); // enjoy an array with no duplicated errors for any given parameter!
})
1reaction
gustavohenkecommented, Nov 23, 2016

Hi @TheHominid. I’m glad that you found something that works for you at the moment.

Anyway, with the introduction of #269, it’s easy to add opt-in support to new methods that fix issues like this. That’s my plan, so this issue can finally be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate Value when parameter names are different and ...
Duplicate Value when parameter names are different and constructor chaining only giving zeros as output. Save this question. Show activity on ...
Read more >
Duplicate row errors leading to non-unique shadow prices
Hi! I'm doing a supply chain optimization using AIMMS for my master project and I have a problem with my binary determinant variable...
Read more >
Duplicates, redundancies and inconsistencies in the primary ...
We demonstrate that duplicates not only introduce redundancy, but can lead to inconsistent results for certain tasks. Our findings lead to a ...
Read more >
Data Duplication – A serious concern with an easy solution
Data duplication is not only a totally unnecessary waste of time but also has the potential to cause major problems and costly mistakes....
Read more >
Duplicate Payments: Best Practices to Prevent Them
There are multiple causes of duplicate or double payments; the good news is there ... ESTABLISH CHECKS AND BALANCES TO REDUCE HUMAN ERROR....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found