Browse Source

修复自定义异常输出提示

master
SmallChi(Koike) 5 years ago
parent
commit
0c23ada9be
2 changed files with 14 additions and 0 deletions
  1. +7
    -0
      src/JTTools/Pages/JT808Analyze.razor
  2. +7
    -0
      src/JTTools/Pages/JT809Parse.razor

+ 7
- 0
src/JTTools/Pages/JT808Analyze.razor View File

@@ -2,6 +2,7 @@


@using JT808.Protocol; @using JT808.Protocol;
@using JT808.Protocol.Extensions; @using JT808.Protocol.Extensions;
@using JT808.Protocol.Exceptions;
@using JTTools.Configs; @using JTTools.Configs;
@using System.Text; @using System.Text;
@using System.Text.Encodings.Web; @using System.Text.Encodings.Web;
@@ -83,6 +84,12 @@
break; break;
} }
} }
catch (JT808Exception ex)
{
isOpen = !isOpen;
Json = "";
ErrerMessage = ex.Message;
}
catch (Exception ex) catch (Exception ex)
{ {
isOpen = !isOpen; isOpen = !isOpen;


+ 7
- 0
src/JTTools/Pages/JT809Parse.razor View File

@@ -5,6 +5,7 @@
@using Newtonsoft.Json; @using Newtonsoft.Json;
@using JT809.Protocol.Configs; @using JT809.Protocol.Configs;
@using JT809.Protocol.Interfaces; @using JT809.Protocol.Interfaces;
@using JT809.Protocol.Exceptions;
@inject IJT809Config Config @inject IJT809Config Config


<select class="form-control" @onchange="@OnSelectEncryptType"> <select class="form-control" @onchange="@OnSelectEncryptType">
@@ -81,6 +82,12 @@
Json = JsonConvert.SerializeObject(jT809SerializerInternal.Deserialize(data), Formatting.Indented); Json = JsonConvert.SerializeObject(jT809SerializerInternal.Deserialize(data), Formatting.Indented);
} }
} }
catch(JT809Exception ex)
{
isOpen = !isOpen;
Json = "";
ErrerMessage = ex.Message;
}
catch(Exception ex) catch(Exception ex)
{ {
isOpen = !isOpen; isOpen = !isOpen;


Loading…
Cancel
Save