diff options
author | Randall Leeds <randall@apache.org> | 2012-03-18 16:00:24 -0700 |
---|---|---|
committer | Robert Newson <robert.newson@cloudant.com> | 2012-10-23 23:08:07 +0100 |
commit | b5e20639dd293b3e21c8d51a35442db247a39fff (patch) | |
tree | fad03de352f7ff1992371b193d56b099d0ef9000 /apps/couch/src/couch_util.erl | |
parent | 3d1812d5ef567a023e68458b1c040b3aac8176e7 (diff) |
don't delete view groups that fail to open
...but log a message instead. Fixes COUCHDB-1445.
Diffstat (limited to 'apps/couch/src/couch_util.erl')
-rw-r--r-- | apps/couch/src/couch_util.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/couch/src/couch_util.erl b/apps/couch/src/couch_util.erl index 839f5956..6e483730 100644 --- a/apps/couch/src/couch_util.erl +++ b/apps/couch/src/couch_util.erl @@ -17,7 +17,7 @@ -export([rand32/0, implode/2, collate/2, collate/3]). -export([abs_pathname/1,abs_pathname/2, trim/1]). -export([encodeBase64Url/1, decodeBase64Url/1]). --export([validate_utf8/1, to_hex/1, parse_term/1, dict_find/3]). +-export([validate_utf8/1, to_hex/1, from_hex/1, parse_term/1, dict_find/3]). -export([get_nested_json_value/2, json_user_ctx/1]). -export([proplist_apply_field/2, json_apply_field/2]). -export([to_binary/1, to_integer/1, to_list/1, url_encode/1]). @@ -148,6 +148,11 @@ to_hex([H|T]) -> to_digit(N) when N < 10 -> $0 + N; to_digit(N) -> $a + N-10. +from_hex(Hex) when is_binary(Hex) -> + mochihex:to_bin(?b2l(Hex)); +from_hex(Hex) when is_list(Hex) -> + mochihex:to_bin(Hex). + parse_term(Bin) when is_binary(Bin) -> parse_term(binary_to_list(Bin)); |