Skip to content
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

fix: Use ConversionNotSupportedException instead of system one #279

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading