Skip to content

Commit

Permalink
fix: Use ConversionNotSupportedException instead of system one (#279)
Browse files Browse the repository at this point in the history
* fix: Use ConversionNotSupportedException instead of system one

* fix: Equivalent fix for civil
  • Loading branch information
AlanRynne authored Sep 25, 2024
1 parent f59a374 commit d8f3fa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Speckle.Converters.Common;
using Speckle.Converters.Common.Objects;
using Speckle.Converters.Common.Registration;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;

namespace Speckle.Converters.Autocad;
Expand All @@ -24,7 +25,7 @@ public Base Convert(object target)
{
if (target is not DBObject dbObject)
{
throw new NotSupportedException(
throw new ConversionNotSupportedException(
$"Conversion of {target.GetType().Name} to Speckle is not supported. Only objects that inherit from DBObject are."
);
}
Expand All @@ -41,7 +42,7 @@ public Base Convert(object target)

if (objectConverter == null)
{
throw new NotSupportedException($"No conversion found for {target.GetType().Name}");
throw new ConversionNotSupportedException($"No conversion found for {target.GetType().Name}");
}

var convertedObject = objectConverter.Convert(dbObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Speckle.Converters.Common;
using Speckle.Converters.Common.Objects;
using Speckle.Converters.Common.Registration;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models;

namespace Speckle.Converters.Civil3d;
Expand All @@ -24,7 +25,7 @@ public Base Convert(object target)
{
if (target is not DBObject dbObject)
{
throw new NotSupportedException(
throw new ConversionNotSupportedException(
$"Conversion of {target.GetType().Name} to Speckle is not supported. Only objects that inherit from DBObject are."
);
}
Expand All @@ -41,7 +42,7 @@ public Base Convert(object target)

if (objectConverter == null)
{
throw new NotSupportedException($"No conversion found for {target.GetType().Name}");
throw new ConversionNotSupportedException($"No conversion found for {target.GetType().Name}");
}

var convertedObject = objectConverter.Convert(dbObject);
Expand Down

0 comments on commit d8f3fa7

Please sign in to comment.