Skip to content

Commit

Permalink
Merge pull request #70 from PositiveTechnologies/Taint
Browse files Browse the repository at this point in the history
Fixed ConversionException initialization
  • Loading branch information
KvanTTT authored Jul 24, 2017
2 parents 7d5abb5 + 17e10e4 commit 6676eca
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Sources/PT.PM.Common/Exceptions/ConversionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public ConversionException(SerializationInfo info, StreamingContext context)
{
}

public ConversionException(string fileName, Exception ex = null, string message = "")
: base(ex, message)
public ConversionException(string fileName, Exception ex = null, string message = "", bool isPattern = false)
: base(ex, message, isPattern)
{
FileName = fileName;
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/PT.PM.Common/Exceptions/MatchingException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public MatchingException()
{
}

public MatchingException(string fileName, Exception ex = null, string message = "")
: base(ex, message)
public MatchingException(string fileName, Exception ex = null, string message = "", bool isPattern = false)
: base(ex, message, isPattern)
{
FileName = fileName;
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/PT.PM.Common/Exceptions/PMException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public PMException()
{
}

public PMException(Exception innerException, string message = "")
public PMException(Exception innerException, string message = "", bool isPattern = false)
: base(message, innerException)
{
IsPattern = isPattern;
}

protected PMException(SerializationInfo info, StreamingContext context)
Expand Down
4 changes: 2 additions & 2 deletions Sources/PT.PM.Common/Exceptions/ParsingException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public ParsingException(SerializationInfo info, StreamingContext context)
{
}

public ParsingException(string fileName, Exception ex = null, string message = "")
: base(ex, message)
public ParsingException(string fileName, Exception ex = null, string message = "", bool isPattern = false)
: base(ex, message, isPattern)
{
FileName = fileName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ public class ShouldNotBeVisitedException : PMException
{
public override PMExceptionType ExceptionType => PMExceptionType.ShouldNotBeVisited;

private readonly string _ruleName;
private readonly string _ruleName = "";

public ShouldNotBeVisitedException()
{
}

public ShouldNotBeVisitedException(string ruleName)
{
Expand Down
4 changes: 2 additions & 2 deletions Sources/PT.PM.Patterns/PatternConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Pattern[] Convert(IEnumerable<PatternDto> patternsDto)
}
catch (Exception ex)
{
Logger.LogError(new ConversionException($"Error while \"{patternDto.Key}\" pattern deserialising ({patternDto.Value}) ", ex));
Logger.LogError(new ConversionException("", ex, $"Error while \"{patternDto.Key}\" pattern deserialising ({patternDto.Value}) ", true));
}
}
return result.ToArray();
Expand All @@ -78,7 +78,7 @@ public PatternDto[] ConvertBack(IEnumerable<Pattern> patterns)
}
catch (Exception ex)
{
Logger.LogError(new ConversionException($"Error while \"{pattern.Key}\" pattern serialising", ex));
Logger.LogError(new ConversionException("", ex, $"Error while \"{pattern.Key}\" pattern serialising", true));
}
}
return result.ToArray();
Expand Down
4 changes: 2 additions & 2 deletions Sources/PT.PM.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PT.PM", "PT.PM\PT.PM.csproj", "{ECB44673-2FB0-49E1-811F-973E3FA4DD22}"
EndProject
Expand Down

0 comments on commit 6676eca

Please sign in to comment.