我们经常在我们的方法中使用try catch语句,如果方法可以返回值,但是值不是字符串,如何返回异常消息?return i; catch (Exception ex) // How to return the ex?// If the return type is a custom class, how to deal with it? }
我正在为我们的应用程序配置需求编写一个基于PowerShell的XML模块。以下是其中一个函数。Update-XMLAttribute is failed"} # End Function Update-XMLAttribute从PowerShell cmdlet获取结果以便使用者知道它是否成功完成的</em