handleException method

dynamic handleException(
  1. DioError e
)

Implementation

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