forked from TrueCloudLab/frostfs-sdk-java
[#14] add lombok and refactor exceptions. Provide validator.
Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
parent
15cf0893c7
commit
388428af76
87 changed files with 819 additions and 970 deletions
|
@ -0,0 +1,49 @@
|
|||
package info.frostfs.sdk.constants;
|
||||
|
||||
public class ErrorConst {
|
||||
public static final String OBJECT_IS_NULL = "object must not be null";
|
||||
public static final String INPUT_PARAM_IS_MISSING = "input parameter is not present";
|
||||
public static final String SOME_PARAM_IS_MISSING = "one of the input parameters is not present";
|
||||
public static final String PARAM_IS_MISSING_TEMPLATE = "param %s is not present";
|
||||
public static final String PARAMS_ARE_MISSING_TEMPLATE = "params %s are not present";
|
||||
public static final String INPUT_PARAM_IS_MISSING_TEMPLATE = "%s value is not present";
|
||||
|
||||
public static final String INPUT_PARAM_GREATER_OR_EQUAL_ZERO = "%s must be greater than or equal to zero";
|
||||
public static final String INPUT_PARAM_GREATER_ZERO = "%s must be greater than zero";
|
||||
|
||||
public static final String REQUIRED_FIELD_TEMPLATE = "%s required field";
|
||||
|
||||
public static final String REQUIRED_PROTO_FIELD_TEMPLATE = "the proto message does not contain a field %s";
|
||||
public static final String UNSUPPORTED_PROTO_MESSAGE_TYPE_TEMPLATE = "unsupported proto message type: %s";
|
||||
public static final String PROTO_MESSAGE_IS_EMPTY_TEMPLATE = "proto message %s must not be empty";
|
||||
public static final String UNEXPECTED_MESSAGE_TYPE_TEMPLATE = "unexpected message type, expected %s, actually %s";
|
||||
|
||||
public static final String WIF_IS_INVALID = "WIF is invalid";
|
||||
public static final String UNEXPECTED_STREAM = "unexpected end of stream";
|
||||
public static final String INVALID_HOST_TEMPLATE = "host %s has invalid format. Error: %s";
|
||||
public static final String INVALID_RESPONSE = "invalid response";
|
||||
public static final String VERSION_UNSUPPORTED_TEMPLATE = "frostFS %s is not supported.";
|
||||
|
||||
public static final String UNKNOWN_ENUM_VALUE_TEMPLATE = "unknown %s value: %s";
|
||||
|
||||
public static final String INPUT_PARAM_IS_NOT_SHA256 = "%s must be a sha256 hash";
|
||||
public static final String DECODE_LENGTH_VALUE_TEMPLATE = "decode array length must be >= 4, but %s";
|
||||
public static final String INVALID_BASE58_CHARACTER_TEMPLATE = "invalid character in Base58: 0x%04x";
|
||||
public static final String INVALID_CHECKSUM = "checksum does not match";
|
||||
public static final String WRONG_SIGNATURE_SIZE_TEMPLATE = "wrong signature size. Expected length=%s, actual=%s";
|
||||
public static final String ENCODED_COMPRESSED_PUBLIC_KEY_WRONG_LENGTH_TEMPLATE =
|
||||
"publicKey isn't encoded compressed public key. Expected length=%s, actual=%s";
|
||||
public static final String UNCOMPRESSED_PUBLIC_KEY_WRONG_LENGTH_TEMPLATE =
|
||||
"compress argument isn't uncompressed public key. Expected length=%s, actual=%s";
|
||||
public static final String COMPRESSED_PUBLIC_KEY_WRONG_LENGTH_TEMPLATE =
|
||||
"decompress argument isn't compressed public key. Expected length=%s, actual=%s";
|
||||
|
||||
public static final String WRONG_UUID_SIZE_TEMPLATE = "uuid byte array length must be %s";
|
||||
|
||||
|
||||
public static final String FIELDS_DELIMITER_COMMA = ", ";
|
||||
public static final String FIELDS_DELIMITER_OR = " or ";
|
||||
|
||||
private ErrorConst() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package info.frostfs.sdk.exceptions;
|
||||
|
||||
public class ProcessFrostFSException extends RuntimeException {
|
||||
public ProcessFrostFSException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ProcessFrostFSException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package info.frostfs.sdk.exceptions;
|
||||
|
||||
public class TimeoutFrostFSException extends RuntimeException {
|
||||
public TimeoutFrostFSException() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package info.frostfs.sdk.exceptions;
|
||||
|
||||
public class ValidationFrostFSException extends RuntimeException {
|
||||
public ValidationFrostFSException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue