Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

21
  • 112
    "the happy path would be that you won" -- No, that's not what the term happy path means. A losing ticket is very much 'happy path' because it's a scenario you should expect to handle in the business logic. Happy Path means that nothing unexpected happens - for example, locked files on disk, database exceptions, network interruptions, internal errors in 3rd-party libraries or API, expired certificate, etc. User auth is the same - a user's invalid username or password is also Happy path. In fact, any kind of user input validation is 'happy path'. Commented Feb 12, 2020 at 8:38
  • 26
    @dumazy 401 is an HTTP response status code. Not an application exception. They are two very distinct concepts. Users entering incorrect passwords is not an exception scenario. Commented Feb 12, 2020 at 8:47
  • 12
    This question is somewhat language specific though, iirc Python encourages use of exceptions in normal control flow. Commented Feb 12, 2020 at 8:48
  • 10
    ericlippert.com/2008/09/10/vexing-exceptions Commented Feb 12, 2020 at 16:48
  • 52
    Ironically, does this mean if you build a lottery system and you win the lottery, you should throw a LotteryWonException, because you never expect to win? Commented Feb 12, 2020 at 18:06