View Issue Details

IDProjectCategoryView StatusLast Update
0029024Open CASCADEOCCT:DRAWpublic2023-08-01 15:08
ReporterabvAssigned Toapn  
PrioritynormalSeverityfeature 
Status newResolutionopen 
Target VersionUnscheduled 
Summary0029024: DRAW - use common approach for reporting error message on wrong command arguments
DescriptionIt is a good practice to output clear error message when DRAW command is called with incorrect arguments. This is done in many commands, however not always in the same way. To provide consistent behavior for all commands, it is proposed to:

1. Define common method for reporting this kind of errors, e.g. Draw_Interpretor::ErrorOnWrongArgs(), to be called as follows:

Standard_Integer mycommand (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
{
  if (theArgc < 3)
  {
    return theDI.ErrorOnWrongArgs (theArgv[0]);
  }
  ...
}


2. Use this method in all DRAW commands

The new method should:

- Print (to std::cerr) error message indicating that command is called with wrong number of arguments

- Print help for the current command to let the user know what arguments are expected (this help should be already recorded when command is added by method Add())

- Return 1 (indicating error in Tcl)
TagsNo tags attached.
Test case number

Relationships

related to 0031731 closedkgv Open CASCADE Draw Harness - colorize errors and exception messages 

Activities

abv

2017-08-21 13:26

manager   ~0069710

Last edited: 2017-08-21 16:49

Method Draw_Interpretor::ErrorOnWrongArgs() is implemented in branch CR29024

git

2017-08-21 16:48

administrator   ~0069722

Branch CR29024 has been created by abv.

SHA-1: 6d61efef1e3a51ef616350ec715ada67816413ac


Detailed log of new commits:

Author: abv
Date: Mon Aug 21 16:48:23 2017 +0300

    0029024: DRAW - use common approach for reporting error message on wrong command arguments
    
    Method Draw_Interpretor::ErrorOnWrongArgs() is added, providing user message for DRAW command called with incorrect arguments.

Issue History

Date Modified Username Field Change
2017-08-21 11:11 abv New Issue
2017-08-21 11:11 abv Assigned To => apn
2017-08-21 13:26 abv Note Added: 0069710
2017-08-21 16:48 git Note Added: 0069722
2017-08-21 16:49 abv Note Edited: 0069710
2019-07-10 22:24 abv Target Version 7.4.0 => 7.5.0
2020-09-11 15:43 utverdov Target Version 7.5.0 => 7.6.0
2021-02-23 10:49 kgv Description Updated
2021-02-23 10:50 kgv Description Updated
2021-02-23 10:54 kgv Relationship added related to 0031731
2021-02-23 10:54 kgv Severity minor => feature
2021-09-09 22:27 kgv Target Version 7.6.0 => 7.7.0
2022-10-24 10:40 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:08 dpasukhi Target Version 7.8.0 => Unscheduled