Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71587

Reconsider program error code selection for exception handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.2
    • Fix Version/s: 5.12.1, 5.13.0 Alpha 1
    • Component/s: Documentation
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      b6a5aff9b7781fb98529e9a4beab0c2f43ac55fe (qt/qtdoc/5.12)

      Description

      I have taken another look at a source code example.

      ...
      try {
          app.exec();
      } catch (const std::bad_alloc &) {
      ...
          return 0; // exit the application
      }
      

      I find the shown program error code questionable here after insufficient memory was detected.
      Can the value "ENOMEM" (or "EXIT_FAILURE") be more appropriate for this use case?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sgaist Samuel Gaist
            Reporter:
            elfring Markus Elfring
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes