From cd598d892faeb14cf2b23542e73ebc1c262b2f95 Mon Sep 17 00:00:00 2001 From: Jay Doane Date: Tue, 6 Mar 2018 18:53:39 -0800 Subject: [PATCH] Add error tuple return type to replicator auth spec and callback The {error, term()} return type is added to both the initialize/1 callback and spec, which matches the underlying implementation. --- src/couch_replicator/src/couch_replicator_auth.erl | 3 ++- src/couch_replicator/src/couch_replicator_auth_session.erl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/couch_replicator/src/couch_replicator_auth.erl b/src/couch_replicator/src/couch_replicator_auth.erl index 1c9a4972320..60273fc32fb 100644 --- a/src/couch_replicator/src/couch_replicator_auth.erl +++ b/src/couch_replicator/src/couch_replicator_auth.erl @@ -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()}. diff --git a/src/couch_replicator/src/couch_replicator_auth_session.erl b/src/couch_replicator/src/couch_replicator_auth_session.erl index 3fff295725a..fedc4c66871 100644 --- a/src/couch_replicator/src/couch_replicator_auth_session.erl +++ b/src/couch_replicator/src/couch_replicator_auth_session.erl @@ -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} ->