How to handle status of a network request with LiveData, ViewModel and update UI accordingly
When network request completes successfully you are setting the value of livedata. Likewise on error set the value of livedata as null and in the Activity check null before updating UI.
Further: If you want to display different types of errors to user. Create a base model class which contains basic Fields like error_code, error_status.