summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-01-15 17:51:20 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-01-15 17:51:20 +0900
commite2589e3b48c4d05db198f7729708ac8bca6f42be (patch)
treefd26c306953a1cf97cd8fd1ea5b7267cbc51d509 /src/bin/eolian_mono
parent130fe0bf7829d1bd8caae4df084c2975ff246a64 (diff)
efl-mono: Only raise exception for managed errors.
Summary: Previously, any unhandled Eina_Error would cause an exception to be thrown when the control returned to C#. This commit changes this behavior to only raise it when an exception went unhandled from a C# callback back to C, like in an event handler, for example. Test Plan: run tests Reviewers: segfaultxavi, Jaehyun_Cho, felipealmeida Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7537
Diffstat (limited to 'src/bin/eolian_mono')
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_helpers.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_pointer.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh6
5 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index 22849a9..c9cb686 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -264,7 +264,7 @@ struct event_definition_generator
264 << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n" 264 << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n"
265 << scope_tab << scope_tab << "} catch (Exception e) {\n" 265 << scope_tab << scope_tab << "} catch (Exception e) {\n"
266 << scope_tab << scope_tab << scope_tab << "Eina.Log.Error(e.ToString());\n" 266 << scope_tab << scope_tab << scope_tab << "Eina.Log.Error(e.ToString());\n"
267 << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" 267 << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
268 << scope_tab << scope_tab << "}\n" 268 << scope_tab << scope_tab << "}\n"
269 << scope_tab << "}\n\n" 269 << scope_tab << "}\n\n"
270 ).generate(sink, attributes::unused, context)) 270 ).generate(sink, attributes::unused, context))
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index b0e2e5e..763bbc4 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -93,7 +93,7 @@ struct native_function_definition_generator
93 << "(" << (native_argument_invocation % ", ") << ");\n" 93 << "(" << (native_argument_invocation % ", ") << ");\n"
94 << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n" 94 << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n"
95 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n" 95 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
96 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" 96 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
97 << scope_tab << scope_tab << scope_tab << "}\n" 97 << scope_tab << scope_tab << scope_tab << "}\n"
98 << eolian_mono::native_function_definition_epilogue(*klass) 98 << eolian_mono::native_function_definition_epilogue(*klass)
99 << scope_tab << scope_tab << "} else {\n" 99 << scope_tab << scope_tab << "} else {\n"
diff --git a/src/bin/eolian_mono/eolian/mono/function_helpers.hh b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
index 017ddad..c83cbbb 100644
--- a/src/bin/eolian_mono/eolian/mono/function_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
@@ -99,7 +99,7 @@ struct function_definition_epilogue_generator
99 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const 99 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
100 { 100 {
101 if (!as_generator( 101 if (!as_generator(
102 scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" 102 scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n"
103 << *(scope_tab << scope_tab << convert_out_assign) 103 << *(scope_tab << scope_tab << convert_out_assign)
104 << *(scope_tab << scope_tab << convert_in_ptr_assign) 104 << *(scope_tab << scope_tab << convert_in_ptr_assign)
105 << scope_tab << scope_tab << convert_return 105 << scope_tab << scope_tab << convert_return
diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
index 95c0e0f..2c62abe 100644
--- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
@@ -90,7 +90,7 @@ struct function_pointer {
90 << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "cb(" << (native_argument_invocation % ", ") << ");\n" 90 << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "cb(" << (native_argument_invocation % ", ") << ");\n"
91 << scope_tab << scope_tab << "} catch (Exception e) {\n" 91 << scope_tab << scope_tab << "} catch (Exception e) {\n"
92 << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n" 92 << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
93 << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" 93 << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
94 << scope_tab << scope_tab << "}\n" 94 << scope_tab << scope_tab << "}\n"
95 << native_function_definition_epilogue(nullptr) 95 << native_function_definition_epilogue(nullptr)
96 << scope_tab << "}\n" 96 << scope_tab << "}\n"
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 907ac97..a22a5a0 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -579,7 +579,7 @@ struct klass
579 << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.data_set(this);\n" 579 << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.data_set(this);\n"
580 << scope_tab << scope_tab << "}\n" 580 << scope_tab << scope_tab << "}\n"
581 << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_end(handle);\n" 581 << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_end(handle);\n"
582 << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" 582 << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n"
583 << scope_tab << "}\n" 583 << scope_tab << "}\n"
584 584
585 << scope_tab << "///<summary>Constructs an instance from a native pointer.</summary>\n" 585 << scope_tab << "///<summary>Constructs an instance from a native pointer.</summary>\n"
@@ -718,7 +718,7 @@ struct klass
718 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to add event proxy for event {key}\");\n" 718 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to add event proxy for event {key}\");\n"
719 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" 719 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
720 << scope_tab << scope_tab << scope_tab << "}\n" 720 << scope_tab << scope_tab << scope_tab << "}\n"
721 << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" 721 << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n"
722 << scope_tab << scope_tab << "} \n" 722 << scope_tab << scope_tab << "} \n"
723 << scope_tab << scope_tab << "event_cb_count[key]++;\n" 723 << scope_tab << scope_tab << "event_cb_count[key]++;\n"
724 << scope_tab << scope_tab << "return true;\n" 724 << scope_tab << scope_tab << "return true;\n"
@@ -740,7 +740,7 @@ struct klass
740 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n" 740 << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n"
741 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" 741 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
742 << scope_tab << scope_tab << scope_tab << "}\n" 742 << scope_tab << scope_tab << scope_tab << "}\n"
743 << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" 743 << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n"
744 << scope_tab << scope_tab << "} else if (event_count == 0) {\n" 744 << scope_tab << scope_tab << "} else if (event_count == 0) {\n"
745 << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when there is nothing registered.\");\n" 745 << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when there is nothing registered.\");\n"
746 << scope_tab << scope_tab << scope_tab << "return false;\n" 746 << scope_tab << scope_tab << scope_tab << "return false;\n"