在 Script# 中,是否可以定义自己的异常类?我不能从 Exception 派生,因为它是密封的:
public class MyException : Exception {} // Cannot inherit from sealed class Exception
如果我尝试抛出一个不从 Exception 继承的异常,我会得到另一个错误:
Error 22 The type caught or thrown must be derived from System.Exception
似乎没有对此的支持?