Skip to content

Instantly share code, notes, and snippets.

@slodge
Created November 25, 2011 09:00
Show Gist options
  • Save slodge/1393086 to your computer and use it in GitHub Desktop.
Save slodge/1393086 to your computer and use it in GitHub Desktop.
Refactoring this... Ctrl R+M
try
{
return (IMXActionResult)actionMethodInfo.Invoke(this, argumentList.ToArray());
}
catch (ArgumentException exception)
{
// this should be impossible - as we've checked the types in the GenerateActionMap method
return ShowError("parameter type mismatch seen " + exception.Message);
}
catch (TargetParameterCountException exception)
{
// this should be impossible as we've created the parameter array above to match the method signature
return ShowError("parameter count mismatch seen " + exception.Message);
}
catch (TargetInvocationException exception)
{
if (exception.InnerException != null)
return ShowError(exception.InnerException);
else
return ShowError("unknown action exception seen " + exception.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment