I store the API error logs in my DB. I found so many errors on my DB. the log message is the same.
SocketException: Failed host lookup: 'xxx.abc.com' (OS Error: No address associated with hostname, errno = 7), StackTrace :
BTW, This error only occurs to random users. Not for all users.
function
Future<dynamic> abc() async {
var responseJson;
try {
final response = await http.post('${env.url}/xxx/xxx/xxx', headers: {'Authorization': 'Bearer xxx'});
responseJson = _response(response, _errorMap);
return responseJson;
}
catch (e, s) {
errorLog.store('$e, StackTrace : $s', _errorMap);
throw FetchDataException('message');
}
}
env.url looks like this, https://xxx.abc.com
xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="xxx">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application ...
package
http: ^0.12.2