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

Review throw new Error for correct usage

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.7.3 [tentative]
    • Component/s: Global
    • Labels:
      None
    • Environment:
      Source code

      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. (It looks like it might always generate a bug report).

      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

      The count is around 85

      Samigo 4
      BasicLTI 8
      JobScheduler 1
      Kernel 3
      Message Center 18 (done in MSGCNTR-489)
      Podcast 28
      rWiki 20

      Feel free to assign sub jira's per project with recognized defects.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  Unassigned Unassigned
                  Reporter:
                  a.m.berg@uva.nl Alan Berg
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration