Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-24633

Static code review - Dont throw new Error in MessageCentre

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.8.0
    • Component/s: Messages Tool
    • Labels:
    • Environment:
      Code review
    • Previous Issue Keys:
      MSGCNTR-489

      Description

      Part of the static code review

      Could you review the following potential bug pattern bug look something like this:

      catch(SomeException e)

      { throw new Error(e); }

      There are a couple of potential issues here:
      1) the raw type Error should not be thrown rather a specific errors (as
      one shouldn't throw Exception)
      2) An exception is being escalated to an error - remember an error
      shouldn't be caught so this should be an app stopping error.

      They can be found with the following:

      grep -C3 -r "throw new Error(" * | grep -v .js | grep -v .svn

      it seems there are a couple of cases where this happens

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  baholladay Bryan Holladay
                  Reporter:
                  arwhyte Anthony Whyte
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration