onError method
Called when an exception was occurred during the request.
Implementation
@override
void onError(DioError err, ErrorInterceptorHandler handler) {
int duration = DateTime.now().difference(_startTime!).inMilliseconds;
_log.write(
'${'✖' * 20} 请求错误: ${(duration / 1000).toStringAsFixed(4)} 秒 ${'✖' * 20}\n');
_log.write('-DioError :$err\n');
printError(_log.toString(), extra);
handler.next(err);
}