aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/wx/src/wxe_master.erl4
-rw-r--r--lib/wx/src/wxe_util.erl8
-rw-r--r--lib/wx/test/wx_basic_SUITE.erl4
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index 06be0367f8..e17a3327ac 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -185,10 +185,10 @@ handle_cast(_Msg, State) ->
%% Description: Handling all non call/cast messages
%%--------------------------------------------------------------------
handle_info({wxe_driver, error, Msg}, State) ->
- error_logger:format("WX ERROR: ~s~n", [Msg]),
+ error_logger:error_report([{wx, error}, {message, lists:flatten(Msg)}]),
{noreply, State};
handle_info({wxe_driver, internal_error, Msg}, State) ->
- error_logger:format("WX INTERNAL ERROR: ~s~n", [Msg]),
+ error_logger:error_report([{wx, internal_error}, {message, lists:flatten(Msg)}]),
{noreply, State};
handle_info({wxe_driver, debug, Msg}, State) ->
io:format("WX DBG: ~s~n", [Msg]),
diff --git a/lib/wx/src/wxe_util.erl b/lib/wx/src/wxe_util.erl
index 3eaf6aebed..bbcd9a65ea 100644
--- a/lib/wx/src/wxe_util.erl
+++ b/lib/wx/src/wxe_util.erl
@@ -82,9 +82,11 @@ rec(Op) ->
{'_wxe_error_', Op, Error} ->
[{_,MF}] = ets:lookup(wx_debug_info,Op),
erlang:error({Error, MF});
- {'_wxe_error_', Old, Error} ->
- [{_,MF}] = ets:lookup(wx_debug_info,Old),
- erlang:exit({Error, MF})
+ {'_wxe_error_', Old, Error} ->
+ [{_,{M,F,A}}] = ets:lookup(wx_debug_info,Old),
+ Msg = io_lib:format("~p in ~w:~w/~w", [Error, M, F, A]),
+ wxe_master ! {wxe_driver, error, Msg},
+ rec(Op)
end.
construct(Op, Args) ->
diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl
index f89f25274a..6a2528780e 100644
--- a/lib/wx/test/wx_basic_SUITE.erl
+++ b/lib/wx/test/wx_basic_SUITE.erl
@@ -192,7 +192,9 @@ wx_api(Config) ->
?m(ok,wxButton:setLabel(Temp, "Testing")),
?m(ok,wxButton:destroy(Temp)),
?m({'EXIT',_},wxButton:getLabel(Temp)),
-
+ ?m(ok,wxButton:setLabel(Temp, "Testing")), %% Should generate an error report
+ ?m({'EXIT',_},wxButton:getLabel(Temp)),
+
case wx_test_lib:user_available(Config) of
true ->
%% Hmm popup doesn't return until mouse is pressed.