Skip to content

Commit

Permalink
Change SerializationException type
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Feb 7, 2019
1 parent 82c7ae3 commit c5614b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ReportPortal.Client/Converters/ModelSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;

Expand All @@ -27,9 +28,9 @@ public static T Deserialize<T>(string json)
{
result = (T)serializer.ReadObject(stream);
}
catch (Exception exp)
catch (SerializationException exp)
{
throw new Exception($"Cannot deserialize json to {typeof(T).Name}.{Environment.NewLine}{json}", exp);
throw new SerializationException($"Cannot deserialize json to '{typeof(T).Name}' type.{Environment.NewLine}{json}", exp);
}

return result;
Expand Down

0 comments on commit c5614b2

Please sign in to comment.