Skip to content

Commit

Permalink
chitika#79 properly handle the list_to_atom operations
Browse files Browse the repository at this point in the history
  • Loading branch information
aoeking committed Sep 29, 2016
1 parent 96ee0c3 commit 356c5cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cberl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -449,5 +449,9 @@ query_arg({startkey, V}) when is_list(V) -> string:join(["startkey", V], "=");

query_arg({startkey_docid, V}) when is_list(V) -> string:join(["startkey_docid", V], "=").

view_error(Error) -> list_to_atom(binary_to_list(Error)).

view_error(Error) ->
ErrorStr = binary_to_list(Error),
case catch list_to_existing_atom(ErrorStr) of
{'EXIT', {badarg, _}} -> list_to_atom(ErrorStr);
TypeAtom -> TypeAtom
end.

0 comments on commit 356c5cb

Please sign in to comment.