Commit 75095b78 by pye52

修复部分二维码扫描异常的问题

parent 043dd808
......@@ -18,7 +18,6 @@ import com.bgycc.smartcanteen.utils.SmartCanteenUtils;
import com.blankj.utilcode.util.LogUtils;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
......@@ -99,8 +98,8 @@ public class QRCodeViewModel extends ViewModel {
JsonObject jsonObject;
try {
jsonObject = JsonParser.parseString(scanData).getAsJsonObject();
} catch (JsonSyntaxException jse) {
LogUtils.e(TAG, "非法的指令格式: " + scanData);
} catch (Exception e) {
LogUtils.e(TAG, "非法的指令格式: " + scanData, e);
qrCodeState.postValue(new QRCodeState(QRCodeState.FAILED));
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment