handleException method

dynamic handleException(
  1. DioError e
)

Implementation

handleException(DioError e) {
  if (e.response != null) {
    debugPrint('Dio error!');
    debugPrint('STATUS: ${e.response?.statusCode}');
    debugPrint('DATA: ${e.response?.data}');
    debugPrint('HEADERS: ${e.response?.headers}');
  } else {
    // Error due to setting up or sending the request
    debugPrint('Error sending request!');
    debugPrint(e.message);
  }
}