diff options
author | Jay Doane <jay.s.doane@gmail.com> | 2018-03-06 18:53:39 -0800 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2018-03-07 09:56:39 -0500 |
commit | cd598d892faeb14cf2b23542e73ebc1c262b2f95 (patch) | |
tree | 476969cfcfdad820c34df1ff2bec04a1f99133f5 | |
parent | 087a1b2e2f18d67077e2aa79d5813d923e09a34d (diff) | |
download | couchdb-cd598d892faeb14cf2b23542e73ebc1c262b2f95.tar.gz |
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.
-rw-r--r-- | src/couch_replicator/src/couch_replicator_auth.erl | 3 | ||||
-rw-r--r-- | 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 1c9a49723..60273fc32 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 3fff29572..fedc4c668 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} -> |