abstraction of error message

pull/1/head
Michael Peter Christen 13 years ago
parent ef0d09f103
commit 9758c521ab

@ -74,8 +74,9 @@ import de.anomic.data.WorkTables;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
public class IndexControlRWIs_p public class IndexControlRWIs_p {
{
private final static String errmsg = "not possible to compute word from hash";
public static serverObjects respond( public static serverObjects respond(
@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final RequestHeader header,
@ -106,7 +107,7 @@ public class IndexControlRWIs_p
if ( post != null ) { if ( post != null ) {
final String keystring = post.get("keystring", "").trim(); final String keystring = post.get("keystring", "").trim();
byte[] keyhash = post.get("keyhash", "").trim().getBytes(); byte[] keyhash = post.get("keyhash", "").trim().getBytes();
if (keystring.length() > 0 && !keystring.contains("not possible to compute word from hash")) { if (keystring.length() > 0 && !keystring.contains(errmsg)) {
keyhash = Word.word2hash(keystring); keyhash = Word.word2hash(keystring);
} }
prop.putHTML("keystring", keystring); prop.putHTML("keystring", keystring);
@ -142,7 +143,7 @@ public class IndexControlRWIs_p
if ( post.containsKey("keyhashsearch") ) { if ( post.containsKey("keyhashsearch") ) {
if ( keystring.length() == 0 || !ByteBuffer.equals(Word.word2hash(keystring), keyhash) ) { if ( keystring.length() == 0 || !ByteBuffer.equals(Word.word2hash(keystring), keyhash) ) {
prop.put("keystring", "<not possible to compute word from hash>"); prop.put("keystring", "<" + errmsg + ">");
} }
final RWIProcess ranking = genSearchresult(prop, sb, segment, keyhash, null); final RWIProcess ranking = genSearchresult(prop, sb, segment, keyhash, null);
if ( ranking.filteredCount() == 0 ) { if ( ranking.filteredCount() == 0 ) {

Loading…
Cancel
Save