View Issue Details

IDProjectCategoryView StatusLast Update
0001701FreeCADFeaturepublic2017-04-28 17:47
Reportershoogen Assigned To 
PrioritynormalSeveritymajorReproducibilityN/A
Status closedResolutionwon't fix 
Product Version 
Target VersionFixed in Version 
Summary0001701: do not catch BaseException, Exception, StandardError or Warning
DescriptionCatch statements should be as specific as possible. Catching "all" Exceptions must be avoided. The current behavior has enormous drawbacks when it comes to interaction with outside python modules.
Additional Informationthis might not be feasible for Pivy
Tagsexception
FreeCAD Information

Relationships

parent of 0001700 closedshoogen do not raise (pythons) base Exception 

Activities

shoogen

2014-09-17 11:13

developer   ~0005112

ed66ada1cfd5d5763d64c0346cb988137c44a6d5 2014-09-17
d$ grep -r -E "except\w*(:|Exception)" src/Mod/ |cut -d "/" -f 3 |sort |uniq -c |sort -rn
    106 Draft
     49 Arch
     31 Ship
     15 OpenSCAD
     13 Spreadsheet
      9 Test
      4 Plot
      4 PartDesign
      4 Import
      1 Start
      1 Sketcher
      1 Robot
      1 Part
      1 Material
      1 Fem
src/App/FreeCADInit.py (after execfile)

shoogen

2014-09-17 11:18

developer   ~0005113

Last edited: 2014-09-17 11:24

View 2 revisions

$ grep -r -E "catch\w* \(\.\.\.\)" src/Mod/ |cut -d "/" -f 3 |sort |uniq -c |sort -rn
     33 Part
      8 Mesh
      3 PartDesign
      2 Sketcher
      1 Web
      1 Raytracing
      1 Points
      1 Fem
      1 Cam

shoogen

2014-09-17 11:21

developer   ~0005114

grep -r -E "catch\w* \(\.\.\.\)" src/$1 |wc -l
 5 Base
12 App
29 Gui

shoogen

2014-09-21 09:48

developer   ~0005142

a way to uncover the type of exceptions is to add a print clause

import FreeCAD,traceback
try:
    pass
except:
    FreeCAD.Console.PrintWarning(traceback.format_exc())

Related Changesets

FreeCAD: master 57db95a1

2014-08-24 19:48:23

shoogen

Details Diff
issue 0001701 removed further except: statements Affected Issues
0001701
mod - src/App/FreeCADInit.py Diff File
mod - src/Mod/Material/importFCMat.py Diff File
mod - src/Mod/Part/MakeBottle.py Diff File
mod - src/Mod/Sketcher/InitGui.py Diff File

FreeCAD: master e820a326

2014-09-18 12:55:35

shoogen


Committer: yorik Details Diff
issue 0001701 Affected Issues
0001701
mod - src/Mod/Arch/ArchCommands.py Diff File
mod - src/Mod/Arch/ArchComponent.py Diff File
mod - src/Mod/Arch/ArchEquipment.py Diff File
mod - src/Mod/Arch/ArchRebar.py Diff File
mod - src/Mod/Arch/ArchSectionPlane.py Diff File
mod - src/Mod/Arch/ArchSpace.py Diff File
mod - src/Mod/Arch/ArchStructure.py Diff File
mod - src/Mod/Arch/ArchVRM.py Diff File
mod - src/Mod/Arch/ArchWindow.py Diff File
mod - src/Mod/Arch/importDAE.py Diff File
mod - src/Mod/Arch/importIFClegacy.py Diff File
mod - src/Mod/Draft/DraftGui.py Diff File
mod - src/Mod/Draft/DraftTrackers.py Diff File
mod - src/Mod/Fem/CalculixLib.py Diff File
mod - src/Mod/Import/InitGui.py Diff File
mod - src/Mod/PartDesign/InitGui.py Diff File
mod - src/Mod/PartDesign/Scripts/Gear.py Diff File
mod - src/Mod/Ship/shipHydrostatics/Tools.py Diff File
mod - src/Mod/Spreadsheet/Spreadsheet.py Diff File

FreeCAD: master 1673ab80

2017-04-28 16:49:11

wmayer

Details Diff
use specialized exception classes Affected Issues
0001701
mod - src/App/Application.cpp Diff File
mod - src/App/Document.cpp Diff File
mod - src/App/DocumentObject.cpp Diff File
mod - src/App/DocumentPyImp.cpp Diff File
mod - src/App/DynamicProperty.cpp Diff File
mod - src/App/Expression.cpp Diff File
mod - src/App/ExpressionParser.l Diff File
mod - src/App/Extension.cpp Diff File
mod - src/App/ExtensionContainer.cpp Diff File
mod - src/App/FeatureTest.cpp Diff File
mod - src/App/GeoFeatureGroupExtension.cpp Diff File
mod - src/App/ObjectIdentifier.cpp Diff File
mod - src/App/Origin.cpp Diff File
mod - src/App/OriginGroupExtension.cpp Diff File
mod - src/App/Property.cpp Diff File
mod - src/App/PropertyExpressionEngine.cpp Diff File
mod - src/App/PropertyFile.cpp Diff File
mod - src/App/PropertyLinks.cpp Diff File
mod - src/App/PropertyStandard.cpp Diff File
mod - src/App/PropertyUnits.cpp Diff File
mod - src/App/Range.cpp Diff File
mod - src/App/lex.ExpressionParser.c Diff File
mod - src/Base/Builder3D.cpp Diff File
mod - src/Base/CoordinateSystem.cpp Diff File
mod - src/Base/Exception.cpp Diff File
mod - src/Base/Exception.h Diff File
mod - src/Base/Interpreter.cpp Diff File
mod - src/Base/Parameter.cpp Diff File
mod - src/Base/PyObjectBase.h Diff File
mod - src/Base/Quantity.cpp Diff File
mod - src/Base/Reader.cpp Diff File
mod - src/Base/Unit.cpp Diff File
mod - src/Base/UnitsApi.cpp Diff File
mod - src/Base/Writer.cpp Diff File
mod - src/Base/XMLTools.h Diff File
mod - src/Base/swigpyrun.inl Diff File
mod - src/Gui/Application.cpp Diff File
mod - src/Gui/Command.cpp Diff File
mod - src/Gui/DlgExpressionInput.cpp Diff File
mod - src/Gui/ExpressionBinding.cpp Diff File
mod - src/Gui/ManualAlignment.cpp Diff File
mod - src/Gui/PythonConsole.cpp Diff File
mod - src/Gui/SelectionFilter.cpp Diff File
mod - src/Gui/SoFCOffscreenRenderer.cpp Diff File
mod - src/Gui/SoTouchEvents.cpp Diff File
mod - src/Gui/View3DInventor.cpp Diff File
mod - src/Gui/View3DInventorViewer.cpp Diff File
mod - src/Gui/ViewProvider.cpp Diff File
mod - src/Gui/ViewProviderExtern.cpp Diff File
mod - src/Gui/ViewProviderOriginGroupExtension.cpp Diff File
mod - src/Gui/WidgetFactory.cpp Diff File
mod - src/Gui/WinNativeGestureRecognizers.cpp Diff File
mod - src/Gui/WorkbenchManager.cpp Diff File
mod - src/Mod/Image/App/ImageBase.cpp Diff File
mod - src/Mod/Mesh/App/Core/MeshKernel.cpp Diff File
mod - src/Mod/Mesh/App/Core/Triangulation.cpp Diff File
mod - src/Mod/Mesh/App/FeatureMeshSetOperations.cpp Diff File
mod - src/Mod/Mesh/App/Mesh.cpp Diff File
mod - src/Mod/Points/App/PointsAlgos.cpp Diff File
mod - src/Mod/Sandbox/App/DocumentProtector.cpp Diff File

Issue History

Date Modified Username Field Change
2014-08-19 13:42 shoogen New Issue
2014-08-19 13:42 shoogen Relationship added parent of 0001700
2014-09-15 17:24 shoogen Tag Attached: exception
2014-09-17 11:13 shoogen Note Added: 0005112
2014-09-17 11:15 shoogen Summary do not catch BaseException, Exception, StandardError or Warnig => do not catch BaseException, Exception, StandardError or Warning
2014-09-17 11:15 shoogen Description Updated View Revisions
2014-09-17 11:18 shoogen Note Added: 0005113
2014-09-17 11:21 shoogen Note Added: 0005114
2014-09-17 11:24 shoogen Note Edited: 0005113 View Revisions
2014-09-17 11:40 shoogen Changeset attached => FreeCAD Master master 57db95a1
2014-09-21 09:48 shoogen Note Added: 0005142
2014-09-27 16:30 yorik Changeset attached => FreeCAD Master master e820a326
2017-04-28 16:53 wmayer Changeset attached => FreeCAD master 1673ab80
2017-04-28 17:47 wmayer Status new => closed
2017-04-28 17:47 wmayer Resolution open => won't fix