Fix issue for checking return value of Interop (#5491)
authorkilig <inkyun.kil@samsung.com>
Tue, 22 Aug 2023 02:28:54 +0000 (11:28 +0900)
committerGitHub <noreply@github.com>
Tue, 22 Aug 2023 02:28:54 +0000 (11:28 +0900)
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs

index 1354735..72f95f1 100755 (executable)
@@ -124,31 +124,34 @@ namespace Tizen.Applications
 
         internal static void CheckException(Interop.WidgetViewerEvas.ErrorCode err)
         {
-            switch (err)
+            if (err != Interop.WidgetViewerEvas.ErrorCode.None)
             {
-                case Interop.WidgetViewerEvas.ErrorCode.Fault:
-                    throw new InvalidOperationException("Fault at unmanaged code");
+                switch (err)
+                {
+                    case Interop.WidgetViewerEvas.ErrorCode.Fault:
+                        throw new InvalidOperationException("Fault at unmanaged code");
 
-                case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied:
-                    throw new UnauthorizedAccessException();
+                    case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied:
+                        throw new UnauthorizedAccessException();
 
-                case Interop.WidgetViewerEvas.ErrorCode.NotSupported:
-                    throw new NotSupportedException();
+                    case Interop.WidgetViewerEvas.ErrorCode.NotSupported:
+                        throw new NotSupportedException();
 
-                case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter:
-                    throw new InvalidOperationException("Invalid parameter error at unmanaged code");
+                    case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter:
+                        throw new InvalidOperationException("Invalid parameter error at unmanaged code");
 
-                case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist:
-                    throw new InvalidOperationException("Already exist");
+                    case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist:
+                        throw new InvalidOperationException("Already exist");
 
-                case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded:
-                    throw new InvalidOperationException("Max exceeded");
+                    case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded:
+                        throw new InvalidOperationException("Max exceeded");
 
-                case Interop.WidgetViewerEvas.ErrorCode.Disabled:
-                    throw new InvalidOperationException("Disabled");
+                    case Interop.WidgetViewerEvas.ErrorCode.Disabled:
+                        throw new InvalidOperationException("Disabled");
 
-                default:
-                    throw new InvalidOperationException("Invalid Operation");
+                    default:
+                        throw new InvalidOperationException("Invalid Operation");
+                }
             }
         }