diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-04-19 16:08:32 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2016-04-19 16:08:32 +0200 |
| commit | c0450138586379a9f8e5554e15a8fc5dde6aece3 (patch) | |
| tree | 2227e8dd3c26a5d3d74736ba0225f92880a35bcd /src | |
| parent | bac2dac787b4ff1c58fae3bdde7d53eea6a0e94c (diff) | |
| download | rabbitmq-server-git-c0450138586379a9f8e5554e15a8fc5dde6aece3.tar.gz | |
rabbit_policy: Fix case clause for missing vhost
If the vhost is missing, `rabbit_vhost:assert(VHost)` throws
`{error, {no_such_vhost, _}}` which is caught by `mnesia:async_dirty/1`
and wrapped inside a tuple which is passed to `exit()`. Therefore,
the catch in the transaction function returns:
`{'EXIT', {throw, {error, {no_such_vhost, _}}}}`
not:
`{error, {no_such_vhost, _}}`
Fixes #759.
[#117522069]
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_policy.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl index a66f353b3f..d04551043e 100644 --- a/src/rabbit_policy.erl +++ b/src/rabbit_policy.erl @@ -242,10 +242,10 @@ update_policies(VHost) -> fun() -> [mnesia:lock({table, T}, write) || T <- Tabs], %% [1] case catch list(VHost) of + {'EXIT', {throw, {error, {no_such_vhost, _}}}} -> + {[], []}; %% [2] {'EXIT', Exit} -> exit(Exit); - {error, {no_such_vhost, _}} -> - {[], []}; %% [2] Policies -> {[update_exchange(X, Policies) || X <- rabbit_exchange:list(VHost)], |
