Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.0.0
-
None
-
None
Description
We're currently using exceptions as means of moving incorrect states between client and server. For example "Can't delete this job id as it already exists", ... I believe that we should encode such issues in more better way and use exceptions only for exceptional state.
public enum SqoopResponseCode { SQOOP_1000("1000", "OK"), SQOOP_2000("2000", "ERROR"); private final String code; private final String message; private SqoopResponseCode(String code, String message) { this.code = code; this.message = message; } public String getCode() { return code; } public String getMessage() { return message; } public static SqoopResponseCode getFromCode(String code) { return SqoopResponseCode.valueOf("SQOOP_" + code); } }