| 17 | "can't encode it!"; |
| 18 | |
| 19 | public interface Errors { |
| 20 | String CLIENT_ERROR = BencodeUtil.error("Oops! Your request is like an alien language to " + |
| 21 | "us, we can't decode it!"); |
| 22 | String INTERNAL_ERROR_60 = BencodeUtil.error("Give us a moment, try again later!", 60); |
| 23 | String INTERNAL_ERROR_120 = BencodeUtil.error("Hold your horses! then try again later!", |
| 24 | 120); |
| 25 | |
| 26 | |
| 27 | } |
| 28 | |
| 29 | public static String error(String reason) { |
| 30 | return encode(Map.of("failure reason", reason)); |