Menu

#596 Improve behavior of procedure parser facing unmatched parentheses

v1.1.x
fixed
None
v1.1.2
Bug Fix
2021-07-16
2021-06-23
Erik Hänel
No

If the procedure interpreter faces unmatches parentheses, it throws that the file is not readable. This should be improved, so that the user might resolve the issue without guessing.

Analysis:

Actually, a reasonable error is already thrown in the ProcedureElement constructor, but it is catched in ProcedureLibrary::constructProcedureElement() member function. The calling function will receive a nullptr, which will then result in a SyntaxError::FILE_NOT_EXIST exception. The latter exception however is reasonable for cases, where the file actually does not exist. A fix should remove the try...catch in constructProcedureElement, so that the actual exception can propagate to the user interface.

Implementation:

  • Implementation: Fix was implemented as proposed by the analysis.
  • Revision: [r911]
  • Implementation test: The error now indicates an unmatched parenthesis.

Documentation:

  • [x] ChangesLog updated
  • [x] Code changes commented
  • Documentation articles:
    • [ ] corresponding documentation articles updated
    • [ ] new documentation articles created
    • [x] not needed
  • Language files:
    • [ ] corresponding language files updated
    • [x] not needed

Tests:

Error messages are now much more informative. Fix implemented successfully.

Related

Commit: [r911]

Discussion

  • Erik Hänel

    Erik Hänel - 2021-06-23
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2021-06-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,23 @@
     If the procedure interpreter faces unmatches parentheses, it throws that the file is not readable. This should be improved, so that the user might resolve the issue without guessing.
    +
    +###Analysis:
    +(*Describe, what's the issue and which changes have to be made*)
    +
    +###Implementation:
    +* Implementation: (*Describe, what you've changed*) 
    +* Revision: [rXXX]
    +* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +
    +###Documentation:
    +* [ ] ChangesLog updated
    +* [ ] Code changes commented
    +* **Documentation articles:**
    
    +    * [ ] corresponding documentation articles updated
    +    * [ ] new documentation articles created
    +    * [ ] not needed
    +* **Language files:**
    +    * [ ] corresponding language files updated
    +    * [ ] not needed
    +
    +###Tests:
    +(*Describe, which tests you performed and their outcome*)
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2021-06-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,7 +1,7 @@
     If the procedure interpreter faces unmatches parentheses, it throws that the file is not readable. This should be improved, so that the user might resolve the issue without guessing.
    
     ###Analysis:
    -(*Describe, what's the issue and which changes have to be made*)
    +Actually, a reasonable error is already thrown in the `ProcedureElement` constructor, but it is catched in `ProcedureLibrary::constructProcedureElement()` member function. The calling function will receive a `nullptr`, which will then result in a `SyntaxError::FILE_NOT_EXIST`  exception. The latter exception however is reasonable for cases, where the file actually does not exist. A fix should remove the `try...catch` in `constructProcedureElement`, so that the actual exception can propagate to the user interface.
    
     ###Implementation:
    
     * Implementation: (*Describe, what you've changed*) 
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2021-06-23
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,20 +4,20 @@
     Actually, a reasonable error is already thrown in the `ProcedureElement` constructor, but it is catched in `ProcedureLibrary::constructProcedureElement()` member function. The calling function will receive a `nullptr`, which will then result in a `SyntaxError::FILE_NOT_EXIST`  exception. The latter exception however is reasonable for cases, where the file actually does not exist. A fix should remove the `try...catch` in `constructProcedureElement`, so that the actual exception can propagate to the user interface.
    
     ###Implementation:
    -* Implementation: (*Describe, what you've changed*) 
    -* Revision: [rXXX]
    -* Implementation test: (*Describe the type of test, which you performed, and if it was successful*)
    +* Implementation: Fix was implemented as proposed by the analysis.
    +* Revision: [r911]
    +* Implementation test: The error now indicates an unmatched parenthesis.
    
     ###Documentation:
    -* [ ] ChangesLog updated
    -* [ ] Code changes commented
    +* [x] ChangesLog updated
    +* [x] Code changes commented
    
     * **Documentation articles:**
         * [ ] corresponding documentation articles updated
         * [ ] new documentation articles created
    -    * [ ] not needed
    +    * [x] not needed
     * **Language files:**
         * [ ] corresponding language files updated
    -    * [ ] not needed
    +    * [x] not needed
    
     ###Tests:
     (*Describe, which tests you performed and their outcome*)
    
    • status: implementing --> testing
     

    Related

    Commit: [r911]

  • Erik Hänel

    Erik Hänel - 2021-07-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -20,4 +20,4 @@
    
         * [x] not needed
    
     ###Tests:
    -(*Describe, which tests you performed and their outcome*)
    +Error messages are now much more informative. Fix implemented successfully.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel