guanqingan / xmemcached

Automatically exported from code.google.com/p/xmemcached
Apache License 2.0
0 stars 0 forks source link

ByteUtils中的checkKey的errorMessage既含有"和`` #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.因为我的key种含有空格
2.在checkKey的时候会抛出一个异常
3.但是errorMessage很confuse,java.lang.IllegalArgumentException: Key contains 
invalid characters:  ``page.list./product/getSizeChart?brandSid=1693&tagSid=206 
 ''
很有迷惑性,我以为``是存在我的key中的非法字符,而空格。

What is the expected output? What do you see instead?
希望一个更好的提示消息帮助问题定位

What version of the product are you using? On what operating system?

Please provide any additional information below.
for (byte b : keyBytes) {
                if (b == ' ' || b == '\n' || b == '\r' || b == 0) {
                    try {
                        throw new IllegalArgumentException(
                                "Key contains invalid characters:  ``"
                                        + new String(keyBytes, "utf-8") + "''");

                    } catch (UnsupportedEncodingException e) {
                    }
                }

Original issue reported on code.google.com by xiaoZ5...@gmail.com on 28 Nov 2011 at 6:28

GoogleCodeExporter commented 9 years ago
这确实不是特别友好,我会改善下

Original comment by killme2...@gmail.com on 29 Nov 2011 at 11:48

GoogleCodeExporter commented 9 years ago
xmemcached 1.3.6 released.

Original comment by killme2...@gmail.com on 19 Mar 2012 at 2:12