`e.failures is not iterable` when trying to access failures
See original GitHub issuesuperstruct version: 0.10.11 node version: 12.17.0
I’m struggling to access failures
and hoping someone here could help out…
const { object, assert, string } = require('superstruct');
const User = object({
firstName: string(),
lastName: string()
});
try {
assert({}, User);
} catch (e) {
for (const failure of e.failures) {
console.log('failure', failure);
}
}
Result: TypeError: e.failures is not iterable
How can I get an actual array of failures? It looks like it’s a generator of some sorts.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
[Bug?]: YN0001: TypeError: e is not iterable #3877 - GitHub
I had been working on trying to upgrade from Yarn 3.0.2 to 3.1.1 in another branch. The problem only happened after having worked...
Read more >TypeError: 'Question' object is not iterable in test case assertion
FAILED (errors=1) Destroying test database for alias 'default'... In the command line: >>> from django.test.utils import setup_test_environment ...
Read more >Demo of Python failure reports with pytest
Here is a nice run of several tens of failures and how pytest presents things ... not f() E assert not 42 E...
Read more >How to gracefully handle failures in a Node.js API client
Intermittent failures across internet works are statistically unusual on the whole, but still bound to occur.
Read more >Demo of Python failure reports with pytest
Here is a nice run of several failures and how pytest presents things: ... assert not f() E assert not 42 E +...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Uhoh, sounds like a bug. Can one of you open another issue for it and I’ll check it out? Thanks!
@ianstormtaylor