-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(autocadcivil): CNX-8389 fixes CA1031 warnings in autocad and civil3d projects #3119
refactor(autocadcivil): CNX-8389 fixes CA1031 warnings in autocad and civil3d projects #3119
Conversation
ConnectorAutocadCivil/ConnectorAutocadCivil/Entry/SpeckleAutocadCommand.cs
Outdated
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Outdated
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Outdated
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Outdated
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Events.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Events.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Receive.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Receive.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Receive.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Selection.cs
Outdated
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.Selection.cs
Show resolved
Hide resolved
ConnectorAutocadCivil/ConnectorAutocadCivil/UI/ConnectorBindingsAutocadCivil.cs
Outdated
Show resolved
Hide resolved
...Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/Converter.AutocadCivil.Utils.cs
Outdated
Show resolved
Hide resolved
.../Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Civil.cs
Outdated
Show resolved
Hide resolved
.../Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Civil.cs
Outdated
Show resolved
Hide resolved
.../Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Civil.cs
Outdated
Show resolved
Hide resolved
.../Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Civil.cs
Show resolved
Hide resolved
@@ -1142,6 +1052,7 @@ public Pipe PipeToSpeckle(CivilDB.Pipe pipe) | |||
// assign additional pipe props | |||
AddNameAndDescriptionProperty(pipe.Name, pipe.Description, specklePipe); | |||
|
|||
// TODO: use !IsFatal() here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch, what is throwing here? Is it the ToString() or can some things be null? Having this many try/catch blocks smells a bit, is there nothing we can do to avoid this? I might be more inclined to call a method that wraps the try/catch if it's unavoidable, unless this is likely to add performance overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing some properties on the pipe
object may throw for undocumented reasons (usually if the property doesn't exist or isn't applicable). It's worth trying to add as many as possible to the pipe, not knowing which may throw, thus the individual try catches.
Leaving this as is since I can't think of a better way to handle it
...nverters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Geometry.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting this to "requested changes". @clairekuang is already working through them and I'll re-review once they're in
… github.com:specklesystems/speckle-sharp into CNX-8389-Handle-CA1031-warnings-in-AutoCAD-projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. Just some missing IsFatal()
calls, a typo and a missing log call 👍🏻
ConnectorAutocadCivil/ConnectorAutocadCivil/Storage/SpeckleStreamManager.cs
Outdated
Show resolved
Hide resolved
...Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/Converter.AutocadCivil.Utils.cs
Outdated
Show resolved
Hide resolved
...Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/Converter.AutocadCivil.Utils.cs
Outdated
Show resolved
Hide resolved
...nverters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Geometry.cs
Outdated
Show resolved
Hide resolved
...nverters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Geometry.cs
Outdated
Show resolved
Hide resolved
Objects/Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.cs
Outdated
Show resolved
Hide resolved
.../Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.Civil.cs
Outdated
Show resolved
Hide resolved
Objects/Converters/ConverterAutocadCivil/ConverterAutocadCivilShared/ConverterAutocadCivil.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great now 🙌🏼
Description & motivation
Fixes CA1031 in Autocad and Civil3D.
Changes:
To-do before merge:
!IsFatal() TODOS