From 0ec90627298b8b7bdc74a3993ca58f1dde14dc26 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 12 Oct 2023 17:47:30 +0800 Subject: ... --- include/cru/platform/Check.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'include/cru/platform/Check.h') diff --git a/include/cru/platform/Check.h b/include/cru/platform/Check.h index 8dc4faac..453521cc 100644 --- a/include/cru/platform/Check.h +++ b/include/cru/platform/Check.h @@ -2,7 +2,6 @@ #include "Exception.h" #include "Resource.h" -#include "cru/common/Format.h" #include "cru/common/String.h" #include @@ -15,10 +14,9 @@ TTarget* CheckPlatform(IPlatformResource* resource, if (resource == nullptr) return nullptr; const auto result = dynamic_cast(resource); if (result == nullptr) { - throw UnsupportPlatformException(Format( - u"Try to convert resource to target platform failed. Platform id of " - "resource to convert: {} . Target platform id: {} .", - resource->GetPlatformId(), target_platform)); + throw PlatformNotMatchException( + resource->GetPlatformId(), target_platform, + u"Try to convert resource to target platform failed."); } return result; } @@ -31,10 +29,9 @@ std::shared_ptr CheckPlatform(const std::shared_ptr& resource, "TSource must be a subclass of INativeResource."); const auto result = std::dynamic_pointer_cast(resource); if (result == nullptr) { - throw UnsupportPlatformException(Format( - u"Try to convert resource to target platform failed. Platform id of " - "resource to convert: {} . Target platform id: {} .", - resource->GetPlatformId(), target_platform)); + throw PlatformNotMatchException( + resource->GetPlatformId(), target_platform, + u"Try to convert resource to target platform failed."); } return result; } -- cgit v1.2.3