Skip to content

Instantly share code, notes, and snippets.

@ivangarzab
Last active March 6, 2024 21:52
Show Gist options
  • Save ivangarzab/5f35510e91bca94afcdb6cc9e9cbcdc7 to your computer and use it in GitHub Desktop.
Save ivangarzab/5f35510e91bca94afcdb6cc9e9cbcdc7 to your computer and use it in GitHub Desktop.
public interface MixhaloError {
String getMessage();
int getErrorCode();
}
public enum ConnectionError implements MixhaloError {
INVALID_WIFI_STATE("", 1000101),
INVALID_CELLULAR_STATE("", 1000102),
INVALID_VENUE_ID("", 1000300),
INVALID_VENUE_PASSCODE("", 1000301),
FAILED_VENUE_NETWORK_FETCH("", 1000402),
FAILED_VENUE_CONNECTION("", 1000500)
;
/**
* Error message to be used to indicate to the user what went wrong.
*/
public String message;
/**
* Error code meant to identify each individual error.
*/
private final int errorCode;
ConnectionError(final String message, final int errorCode) {
this.message = message;
this.errorCode = errorCode;
}
@Override
public String getMessage() {
return message;
}
@Override
public int getErrorCode() {
return errorCode;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment