Flutter 颤振型';无此方法错误';不是类型为';例外情况';
我正在尝试在修补数据时导航服务器是否响应401。Flutter 颤振型';无此方法错误';不是类型为';例外情况';,flutter,http,dart,client,Flutter,Http,Dart,Client,我正在尝试在修补数据时导航服务器是否响应401。 我已经检查了请求的响应是否通过DevTool收到 Future<void> patchLolBySummonerName(String summonerName) async { try{ final response = await client.patch('${BASE_URL}user/lol', body: {'summonerName': summonerName}); log('resp
我已经检查了请求的响应是否通过DevTool收到
Future<void> patchLolBySummonerName(String summonerName) async {
try{
final response = await client.patch('${BASE_URL}user/lol', body: {'summonerName': summonerName});
log('response code: ${response.statusCode}');
if(response.statusCode == 200) {
return;
}
NetworkErrorHandler.throwProperException(response);
return null;
} catch(e) {
log('network error: ${e.toString()}');
throw e;
}
}
下面是我通过上面代码记录的日志
[log] network error: type 'NoSuchMethodError' is not a subtype of type 'Exception'
[log] network error: type 'NoSuchMethodError' is not a subtype of type 'Exception'