Skip to content

Commit

Permalink
Add error tuple return type to replicator auth spec and callback
Browse files Browse the repository at this point in the history
The {error, term()} return type is added to both the initialize/1
callback and spec, which matches the underlying implementation.
  • Loading branch information
jaydoane authored and nickva committed Mar 7, 2018
1 parent 087a1b2 commit cd598d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/couch_replicator/src/couch_replicator_auth.erl
Expand Up @@ -33,7 +33,8 @@

% Behavior API

-callback initialize(#httpdb{}) -> {ok, #httpdb{}, term()} | ignore.
-callback initialize(#httpdb{}) ->
{ok, #httpdb{}, term()} | {error, term()} | ignore.

-callback update_headers(term(), headers()) -> {headers(), term()}.

Expand Down
3 changes: 2 additions & 1 deletion src/couch_replicator/src/couch_replicator_auth_session.erl
Expand Up @@ -100,7 +100,8 @@

% Behavior API callbacks

-spec initialize(#httpdb{}) -> {ok, #httpdb{}, term()} | ignore.
-spec initialize(#httpdb{}) ->
{ok, #httpdb{}, term()} | {error, term()} | ignore.
initialize(#httpdb{} = HttpDb) ->
case init_state(HttpDb) of
{ok, HttpDb1, State} ->
Expand Down

0 comments on commit cd598d8

Please sign in to comment.