Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bubble db not found errors #46

Merged
merged 1 commit into from

2 participants

@davisp
Owner

When requesting the _changes feed of a deleted database with a continuous
or longpoll style we would return a 400 Bad Request error instead of
the correct 404 Not Found. This was because we were swallowing all
errors when validating the since parameter. This patch just catches
the except and returns it appropriately.

BugzId: 13125

@davisp davisp Bubble db not found errors
When requesting the _changes feed of a deleted database with a continuous
or longpoll style we would return a `400 Bad Request` error instead of
the correct `404 Not Found`. This was because we were swallowing all
errors when validating the `since` parameter. This patch just catches
the except and returns it appropriately.

BugzId: 13125
12930e5
@kocolosk kocolosk merged commit d9ce500 into 1.6.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 12, 2012
  1. @davisp

    Bubble db not found errors

    davisp authored
    When requesting the _changes feed of a deleted database with a continuous
    or longpoll style we would return a `400 Bad Request` error instead of
    the correct `404 Not Found`. This was because we were swallowing all
    errors when validating the `since` parameter. This patch just catches
    the except and returns it appropriately.
    
    BugzId: 13125
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/fabric_view_changes.erl
View
9 src/fabric_view_changes.erl
@@ -314,9 +314,12 @@ wait_db_updated(Timeout) ->
validate_start_seq(DbName, Seq) ->
try unpack_seqs(Seq, DbName) of _Any ->
ok
- catch _:_ ->
- Reason = <<"Malformed sequence supplied in 'since' parameter.">>,
- {error, {bad_request, Reason}}
+ catch
+ error:database_does_not_exist ->
+ {error, database_does_not_exist};
+ _:_ ->
+ Reason = <<"Malformed sequence supplied in 'since' parameter.">>,
+ {error, {bad_request, Reason}}
end.
unpack_seqs_test() ->
Something went wrong with that request. Please try again.