From 038b9dd3a1f9bdd86cbb83bf3484ab1529d4fca2 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 29 Nov 2011 15:37:11 +0100 Subject: Fix dialyzer warnings in supervisor Dialyzer complained over a mismatch between the callback spec of Mod:code_change in gen_server and the spec of supervisor:code_change (which is the implementation of a gen_server Mod:code_change). This commit changes the callback spec to allow {error,Reason} as return value. Also, release_handler is updated to handle this return value. --- lib/stdlib/doc/src/gen_server.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml index 1045766e01..edeb7dff91 100644 --- a/lib/stdlib/doc/src/gen_server.xml +++ b/lib/stdlib/doc/src/gen_server.xml @@ -4,7 +4,7 @@
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -570,13 +570,14 @@ gen_server:abcast -----> Module:handle_cast/2 - Module:code_change(OldVsn, State, Extra) -> {ok, NewState} + Module:code_change(OldVsn, State, Extra) -> {ok, NewState} | {error, Reason} Update the internal state during upgrade/downgrade. OldVsn = Vsn | {down, Vsn}   Vsn = term() State = NewState = term() Extra = term() + Reason = term()

This function is called by a gen_server when it should @@ -595,7 +596,10 @@ gen_server:abcast -----> Module:handle_cast/2

State is the internal state of the gen_server.

Extra is passed as-is from the {advanced,Extra} part of the update instruction.

-

The function should return the updated internal state.

+

If successful, the function shall return the updated + internal state.

+

If the function returns {error,Reason}, the ongoing + upgrade will fail and roll back to the old release.

-- cgit v1.2.3