opt: handle grpc error

This commit is contained in:
bggRGjQaUbCoE
2024-10-14 10:20:52 +08:00
parent e4ae8961e4
commit 6a99dbfe95
3 changed files with 34 additions and 32 deletions

View File

@@ -102,6 +102,11 @@ class GrpcRepo {
try {
return await request();
} catch (e) {
if (e is GrpcError) {
if (e.message == '12061') {
return {'status': false, 'msg': 'UP主已关闭评论区'}; // to be comfirm
}
}
return {'status': false, 'msg': e.toString()};
}
}