3
inaba
6y

TIL if you try to add a user with ~invalid~ data you get fucking nothing!

Like it continues, like it would normally, but nothing gets inserted to the database and no exception is thrown.

Fukcing

Comments
  • 3
    You really should await that async, but it might work if you assign it to a var (Task), call wait() on that, then check for an Exception on the task.
  • 1
    @spongessuck This async is from a database seeder which will be called on startup. Awaiting it wouldn't really give me anything (and it didn't even give me an exception lmao)
  • 1
    Don't use wait()... If you can't use async/await. You should use CreateAsync(...).GetAwaiter().GetResult(); or
    CreateAsync(...).ContinueWith(r=>{//your stufs});

    And read the docs about how handles with tasks. Really this strange behavior isn't C# fault.
  • 1
    Never .Wait() without a timeout.
Add Comment