diff options
author | Loïc Hoguin <[email protected]> | 2011-04-03 15:21:29 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-04-03 15:21:29 +0200 |
commit | a8af32c54ba35dde5edd11c5be720c1883f54335 (patch) | |
tree | a4d8e23ae4a2e02f3fe0e252153ad7e9e358f71d /src | |
parent | cb079c8a348cbaa2e6cb26ce7ad0a6e09481bd85 (diff) | |
download | cowboy-a8af32c54ba35dde5edd11c5be720c1883f54335.tar.gz cowboy-a8af32c54ba35dde5edd11c5be720c1883f54335.tar.bz2 cowboy-a8af32c54ba35dde5edd11c5be720c1883f54335.zip |
Don't ignore the return values in cowboy:stop_listener/1.
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cowboy.erl b/src/cowboy.erl index 6931114..6aa5786 100644 --- a/src/cowboy.erl +++ b/src/cowboy.erl @@ -27,7 +27,11 @@ start_listener(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) -> ]}, permanent, 5000, supervisor, [cowboy_listener_sup]}). --spec stop_listener(Ref::term()) -> ok. +-spec stop_listener(Ref::term()) -> ok | {error, not_found}. stop_listener(Ref) -> - supervisor:terminate_child(cowboy_sup, {cowboy_listener_sup, Ref}), - supervisor:delete_child(cowboy_sup, {cowboy_listener_sup, Ref}). + case supervisor:terminate_child(cowboy_sup, {cowboy_listener_sup, Ref}) of + ok -> + supervisor:delete_child(cowboy_sup, {cowboy_listener_sup, Ref}); + {error, Reason} -> + {error, Reason} + end. |