diff options
author | crupest <crupest@outlook.com> | 2023-10-12 17:47:30 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-10-12 17:47:30 +0800 |
commit | 0ec90627298b8b7bdc74a3993ca58f1dde14dc26 (patch) | |
tree | 6bd6d25debf39bf969864b75599e824497b094a6 /include/cru/platform/Check.h | |
parent | 9a077caa6d3f7eb8255ae68916dccac9b50a4333 (diff) | |
download | cru-0ec90627298b8b7bdc74a3993ca58f1dde14dc26.tar.gz cru-0ec90627298b8b7bdc74a3993ca58f1dde14dc26.tar.bz2 cru-0ec90627298b8b7bdc74a3993ca58f1dde14dc26.zip |
...
Diffstat (limited to 'include/cru/platform/Check.h')
-rw-r--r-- | include/cru/platform/Check.h | 15 |
1 files changed, 6 insertions, 9 deletions
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 <memory> @@ -15,10 +14,9 @@ TTarget* CheckPlatform(IPlatformResource* resource, if (resource == nullptr) return nullptr; const auto result = dynamic_cast<TTarget*>(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<TTarget> CheckPlatform(const std::shared_ptr<TSource>& resource, "TSource must be a subclass of INativeResource."); const auto result = std::dynamic_pointer_cast<TTarget>(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; } |