Skip to content

Commit

Permalink
Instrumentation - Dumping function parameter values when a function t…
Browse files Browse the repository at this point in the history
…hrows an unhandled exception.
  • Loading branch information
NileshGhodekar committed Apr 14, 2017
1 parent 0d8727a commit e419078
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ All notable changes to MIMWAL project will be documented in this file. The "Unre
* Support for multi-valued attributes in `[//Effective]` lookup in AuthZ workflows.
* Implement Approve Request Activity.

### Version 2.17.0322.0
### Version 2.17.0414.0

#### Added

* Support for executing SQL stored procedures and queries with the implementation of following new functions:
* Support for executing SQL stored procedures and queries for SQL Server and ODBC Data Sources with the implementation of following new functions:
* New function [CreateSqlParameter][CreateSqlParameterFunction]
* New function [CreateSqlParameter2][CreateSqlParameter2Function]
* New function [ExecuteSqlNonQuery][ExecuteSqlNonQueryFunction]
Expand Down
4 changes: 2 additions & 2 deletions src/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "2.17.0322.0";
internal const string Version = "2.17.0414.0";

/// <summary>
/// File Version information for the assembly consists of the following four values:
Expand All @@ -31,6 +31,6 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string FileVersion = "2.17.0322.0";
internal const string FileVersion = "2.17.0414.0";
}
}
40 changes: 39 additions & 1 deletion src/WorkflowActivityLibrary/Common/ExpressionFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,45 @@ public object Run()
}
catch (Exception ex)
{
throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRunUnknownFunctionExecutionError, new InvalidFunctionOperationException(Messages.ExpressionFunction_UnknownFunctionExecutionError, this.mode.ToString().ToLowerInvariant(), ex, this.function, ex.Message));
// dump all function parameters in an error log entry
string paramString = string.Empty;
if (this.mode != EvaluationMode.Parse)
{
try
{
if (this.parameters != null && this.parameters.Count > 0)
{
for (var i = 0; i < this.parameters.Count; ++i)
{
var parameter = this.parameters[i];
paramString += "'";
if (parameter != null)
{
try
{
paramString += Convert.ToString(parameter) + "',";
}
catch (Exception)
{
// let it print without the ending single quote as an indication of the conversion failure
}
}
else
{
paramString += "',";
}
}
}

paramString = "(" + paramString.TrimEnd(',') + ")";
}
catch (Exception)
{
// do nothing - silenty ignore
}
}

throw Logger.Instance.ReportError(EventIdentifier.ExpressionFunctionRunUnknownFunctionExecutionError, new InvalidFunctionOperationException(Messages.ExpressionFunction_UnknownFunctionExecutionError, this.mode.ToString().ToLowerInvariant(), ex, this.function + paramString, ex.Message));
}
finally
{
Expand Down

0 comments on commit e419078

Please sign in to comment.