ErrorListner function
Future<void>
ErrorListner({
- dynamic apiname,
- dynamic request,
- dynamic responsed,
- dynamic app_error,
Implementation
Future<void> ErrorListner({apiname, request, responsed, app_error}) async {
try {
// Send error log to your API
http.Response response = await http.post(
Uri.parse('${BASE_URL}app_log'),
body: {
"apiname": '${WELLNESS_URL}${apiname}',
"token": '$currentUserToken',
"request": request ?? '',
"response": responsed ?? '',
"app_error": app_error ?? '',
},
);
var decodedResponse = json.decode(response.body);
await _sendErrorEmail(
apiname: apiname,
request: request,
response: responsed,
appError: app_error,
);
} catch (e) {
print("Error in ErrorListner: $e");
}
}