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

Reconsider program error code selection for exception handling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.1, 5.13.0 Alpha 1
    • 5.11.2
    • Documentation
    • None
    • All
    • 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

            sgaist Samuel Gaist
            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