mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
[Fixes #6526] Unwrap TargetInvocationException when executing a ShapeAttributeBinding
This commit is contained in:
parent
26e2fe9977
commit
aae9f6270e
@ -60,12 +60,18 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy {
|
||||
var output = new HtmlStringWriter();
|
||||
var arguments = methodInfo.GetParameters()
|
||||
.Select(parameter => BindParameter(displayContext, parameter, output));
|
||||
|
||||
var returnValue = methodInfo.Invoke(serviceInstance, arguments.ToArray());
|
||||
if (methodInfo.ReturnType != typeof(void)) {
|
||||
output.Write(CoerceHtmlString(returnValue));
|
||||
try {
|
||||
var returnValue = methodInfo.Invoke(serviceInstance, arguments.ToArray());
|
||||
if (methodInfo.ReturnType != typeof(void)) {
|
||||
output.Write(CoerceHtmlString(returnValue));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
catch(TargetInvocationException e) {
|
||||
// Throwing a TIE here will probably kill the web process
|
||||
// in Azure. For unknown reasons.
|
||||
throw e.InnerException;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
private static IHtmlString CoerceHtmlString(object invoke) {
|
||||
|
Loading…
Reference in New Issue
Block a user