Skip to content

Commit

Permalink
Add parameter to error message string format
Browse files Browse the repository at this point in the history
One string template had 5 parameters but the parameter list
only contained 4. Calls to orber_ifr:get_module/2 should now
not create malformed error messages if entry is not found in
Mnesia.
  • Loading branch information
Gustav Simonsson committed Jan 27, 2012
1 parent 9d2a2e3 commit df9f0c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/orber/src/orber_ifr.erl
Expand Up @@ -478,7 +478,7 @@ get_module(Id, Type) ->
What ->
orber:dbg("[~p] ~p:get_module(~p, ~p).~n"
"Id doesn't exist, mismatch Id vs Type or DB error: ~p",
[?LINE, ?MODULE, Id, What], ?DEBUG_LEVEL),
[?LINE, ?MODULE, Id, Type, What], ?DEBUG_LEVEL),
corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE})
end.

Expand Down
36 changes: 33 additions & 3 deletions lib/orber/test/orber_SUITE.erl
Expand Up @@ -20,7 +20,6 @@
-module(orber_SUITE).
-include_lib("test_server/include/test_server.hrl").


-define(default_timeout, ?t:minutes(15)).
-define(application, orber).

Expand All @@ -31,7 +30,11 @@

% Test cases must be exported.
-export([app_test/1, undefined_functions/1, install_load_order/1,
install_local_content/1]).
install_local_content/1,
otp_9887/1]).

%% Exporting error handler callbacks for use in otp_9887
-export([init/1, handle_event/2]).

%%
%% all/1
Expand All @@ -40,7 +43,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].

all() ->
[app_test, undefined_functions, install_load_order,
install_local_content].
install_local_content,
otp_9887].

groups() ->
[].
Expand Down Expand Up @@ -76,6 +80,27 @@ app_test(_Config) ->
?line ok=?t:app_test(orber),
ok.

otp_9887(_Config) ->
orber:jump_stop(),
application:set_env(orber, orber_debug_level, 10),
orber:jump_start([]),

mnesia:create_table(orber_light_ifr, []),

error_logger:add_report_handler(?MODULE,[self()]),
catch orber_ifr:get_module(foo, bar),

receive
{stolen,Reason} ->
{error,_Pid1, {_Pid2, _ErrorString, ArgumentList}} = Reason,
5 = length(ArgumentList)
after 500 ->
test_server:fail("OTP_9887 TIMED OUT")
end,

orber:jump_stop(),
ok.

%% Install Orber using the load_order option.
install_load_order(suite) ->
[];
Expand Down Expand Up @@ -192,5 +217,10 @@ key1search(Key, L) ->
fail(Reason) ->
exit({suite_failed, Reason}).

%% Error handler

init([Proc]) -> {ok,Proc}.

handle_event(Event, Proc) ->
Proc ! {stolen,Event},
{ok,Proc}.

0 comments on commit df9f0c0

Please sign in to comment.