From: Eunki, Hong Date: Thu, 12 Dec 2024 12:13:31 +0000 (+0900) Subject: Seperate Dali::Exception / std::exception and otherwise X-Git-Tag: dali_2.3.54~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F316307%2F1;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Seperate Dali::Exception / std::exception and otherwise Until now, SWIG_UnknownError, SWIG_RuntimeError, SWIG_SystemError are all catched as SWIG_CSharpApplicationException. It make hard to debuging error case by exception. To make more detail, let we seperate the callback of exception as System / InvaildOperation / and Application. Change-Id: I5532e1c03de525a4a3e449f6d65224bf544fff64 Signed-off-by: Eunki, Hong --- diff --git a/dali-csharp-binder/common/common.h b/dali-csharp-binder/common/common.h index 2051d47c..7ff1b888 100755 --- a/dali-csharp-binder/common/common.h +++ b/dali-csharp-binder/common/common.h @@ -2,7 +2,7 @@ #define CSHARP_COMMON_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,6 +105,7 @@ constexpr static int SWIG_SystemError = -10; constexpr static int SWIG_AttributeError = -11; constexpr static int SWIG_MemoryError = -12; constexpr static int SWIG_NullReferenceError = -13; +constexpr static int SWIG_DaliError = -14; /* Support for throwing C# exceptions from C/C++. There are two types: * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */ @@ -184,7 +185,7 @@ SWIG_ExceptionMessageWithFileAndLine((code), (what), __FILE__, __LINE__, __FUNCT } \ catch (Dali::DaliException e) \ { \ - SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_SystemError, e.condition); \ + SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_DaliError, e.condition); \ return ret; \ } \ catch (abi::__forced_unwind &) \ @@ -212,7 +213,7 @@ SWIG_ExceptionMessageWithFileAndLine((code), (what), __FILE__, __LINE__, __FUNCT } \ catch (Dali::DaliException e) \ { \ - SWIG_ExceptionMessageWithFileAndLine(SWIG_SystemError, e.condition, (filename), (linenumber), (funcname)); \ + SWIG_ExceptionMessageWithFileAndLine(SWIG_DaliError, e.condition, (filename), (linenumber), (funcname)); \ return ret; \ } \ catch (abi::__forced_unwind &) \ @@ -242,7 +243,7 @@ SWIG_ExceptionMessageWithFileAndLine((code), (what), __FILE__, __LINE__, __FUNCT } \ catch (Dali::DaliException e) \ { \ - SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_SystemError, e.condition); \ + SWIG_EXCEPTION_WITH_FILE_AND_LINE(SWIG_DaliError, e.condition); \ (*(func))(__VA_ARGS__); \ return ret; \ } \ diff --git a/dali-csharp-binder/common/dali-wrap.cpp b/dali-csharp-binder/common/dali-wrap.cpp index 8dd749e1..88ac7659 100644 --- a/dali-csharp-binder/common/dali-wrap.cpp +++ b/dali-csharp-binder/common/dali-wrap.cpp @@ -371,13 +371,18 @@ void SWIG_CSharpException(int code, const char *msg) { case SWIG_OverflowError: exception_code = SWIG_CSharpOverflowException; break; + case SWIG_DaliError: ///< Dali::Exception + exception_code = SWIG_CSharpApplicationException; + break; case SWIG_RuntimeError: + exception_code = SWIG_CSharpInvalidOperationException; + break; case SWIG_TypeError: case SWIG_SyntaxError: case SWIG_SystemError: case SWIG_UnknownError: default: - exception_code = SWIG_CSharpApplicationException; + exception_code = SWIG_CSharpSystemException; break; } SWIG_CSharpSetPendingException(exception_code, msg);