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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So there's a try/catch/throw, and the inner exception appears in the log, but it's not reflected in the thrown error. This is probably fine when you're seeding from an interactive terminal, but in my case it was a headless background process (a Cypress task), and it took some extra digging to get at that log output.
Instead, could typeorm-seeding rethrow the underlying exception, perhaps prepending something like "Could not save entity:" on the error message?
Would you be open to a contribution that does this?
The text was updated successfully, but these errors were encountered:
Sorry for the late response. We would for sure want to rethrow the exception here with the message and error.
If you are still up to contribute, just sent a PR with the change.
I spent some time chasing down a bug today, where the only visible error was "Could not save entity". Here's the relevant code from typeorm-seeding:
typeorm-seeding/src/entity-factory.ts
Lines 46 to 53 in 4136b0e
So there's a try/catch/throw, and the inner exception appears in the log, but it's not reflected in the thrown error. This is probably fine when you're seeding from an interactive terminal, but in my case it was a headless background process (a Cypress task), and it took some extra digging to get at that log output.
Instead, could typeorm-seeding rethrow the underlying exception, perhaps prepending something like "Could not save entity:" on the error message?
Would you be open to a contribution that does this?
The text was updated successfully, but these errors were encountered: