Skip to content

Instantly share code, notes, and snippets.

@ivangarzab
Created March 5, 2024 23:18
Show Gist options
  • Save ivangarzab/c63ae208550894f5e2de5cc0ab11a8cf to your computer and use it in GitHub Desktop.
Save ivangarzab/c63ae208550894f5e2de5cc0ab11a8cf to your computer and use it in GitHub Desktop.
MixhaloError enum class alternative
public enum MixhaloError {
/**
* Problem: Mixhalo was unable to login to the backend server.
* Solution: Check credentials.
*/
FAILED_AUTHENTICATION("Authentication failed", 1000400),
/**
* Problem: Failed to fetch venue list due to the required location services being disabled.
* Solution: Turn on location services for the device.
*/
INVALID_LOCATION_SERVICE_STATE("Location services are turned off", 1000100),
/**
* Problem: Failed to fetch venue list due to a server issue.
* Solution: Try again later, or change the request parameters for a different attempt.
*/
FAILED_VENUE_LIST_FETCH("Venue list fetch failed", 1000401),
/**
* Problem: Failed connection attempt due to an invalid venueId being provided through the request.
* Solution: Make another connection attempt with a valid venueId parameter.
*/
INVALID_VENUE_ID("Connection attempt with invalid venueId failed", 1000300),
/**
* Problem: Failed connection attempt due to missing passcode data for a protected event.
* Solution: Make another connection attempt with valid passcode parameter.
*/
INVALID_VENUE_PASSCODE("Unable to connect due to invalid passcode", 1000301),
/**
* Problem: Failed connection attempt due to server error fetching network data.
* Solution: Try again later, or change the request parameters for a different attempt.
*/
FAILED_VENUE_NETWORK_FETCH("Venue network fetch failed", 1000402),
/**
* Problem: Failed connection attempt due to WiFi services being disabled while needed.
* Solution: Turn on WiFi services for the device, and try again.
*/
INVALID_WIFI_STATE("WiFi services are turned off", 1000101),
/**
* Problem: Failed connection attempt due to Mobile Data being disabled while needed.
* Solution: Turn on Mobile Data for the device, and try again.
*/
INVALID_CELLULAR_STATE("Mobile data is turned off", 1000102),
/**
* Problem: Failed connection attempt due to a connectivity error from the device.
* Solution: Try again, and make sure the network you're trying to connect to is reachable.
*/
FAILED_VENUE_CONNECTION("Venue network connection failed", 1000500),
/**
* Problem: Failed to fetch event media.
* Solution: Try again later.
*/
FAILED_EVENT_MEDIA_FETCH("Event media fetch failed", 1000403),
/**
* Problem: Unable to start playback due to an incompatible engine state.
* Solution: Try again later.
*/
INVALID_AUDIO_ENGINE_STATE("Unable to play due to invalid audio engine state", 1000900),
/**
* Problem: Unable to start playback due to missing headphones.
* Solution: Connect headphones to the device, and try again.
*/
MISSING_HEADPHONES_ANY("Unable to play due to missing headphones", 1000600),
/**
* Problem: Unable to start playback due to missing wired headphones.
* Solution: Connect wired headphones to the device, and try again.
*/
MISSING_HEADPHONES_WIRED("Unable to play due to missing wired headphones", 1000601),
/**
* Problem: Unable to start playback due to an invalid mixId.
* Solution: Make another play request with a valid mixId.
*/
INVALID_MIX("Unable to play due to invalid mix", 1000302),
/**
* Problem: Failed to start playback due to missing microphone permissions, which are required.
* Solution: Grant microphone permissions for the Mixhalo-powered app.
*/
MISSING_PERMISSION_MICROPHONE("Unable to play due to missing mic permissions", 1000200);
/**
* Error message to be used to indicate to the user what went wrong.
*/
public String message;
/**
* Error code meant to identify each individual error.
*/
public int errorCode;
Error(final String message, final int errorCode) {
this.message = message;
this.errorCode = errorCode;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment