Merge pull request #1327 from PowerShell/adityap/stackoverflow

Fix stackoverflow issue by using strongly typed resource names
This commit is contained in:
adityapatwardhan
2016-07-08 15:41:46 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
@@ -94,7 +94,7 @@ namespace System.Management.Automation.Runspaces
}
_errorRecord = new ErrorRecord(new ParentContainsErrorRecordException(this), "ConsoleLoadFailure", ErrorCategory.ResourceUnavailable, null);
_errorRecord.ErrorDetails = new ErrorDetails(typeof(PSConsoleLoadException).GetTypeInfo().Assembly, "ConsoleInfoErrorStrings", "ConsoleLoadFailure", _consoleFileName, sb.ToString());
_errorRecord.ErrorDetails = new ErrorDetails(String.Format(ConsoleInfoErrorStrings.ConsoleLoadFailure, _consoleFileName, sb.ToString()));
}
private ErrorRecord _errorRecord;
@@ -113,12 +113,12 @@ namespace System.Management.Automation.Runspaces
if (_warning)
{
_errorRecord = new ErrorRecord(new ParentContainsErrorRecordException(this), "PSSnapInLoadWarning", ErrorCategory.ResourceUnavailable, null);
_errorRecord.ErrorDetails = new ErrorDetails(currentAssembly, "ConsoleInfoErrorStrings", "PSSnapInLoadWarning", _PSSnapin, _reason);
_errorRecord.ErrorDetails = new ErrorDetails(String.Format(ConsoleInfoErrorStrings.PSSnapInLoadWarning, _PSSnapin, _reason));
}
else
{
_errorRecord = new ErrorRecord(new ParentContainsErrorRecordException(this), "PSSnapInLoadFailure", ErrorCategory.ResourceUnavailable, null);
_errorRecord.ErrorDetails = new ErrorDetails(currentAssembly, "ConsoleInfoErrorStrings", "PSSnapInLoadFailure", _PSSnapin, _reason);
_errorRecord.ErrorDetails = new ErrorDetails(String.Format(ConsoleInfoErrorStrings.PSSnapInLoadFailure, _PSSnapin, _reason));
}
}
}