public static void Register(Type t) { try { COMHelper.RegasmRegisterLocalServer(t); } catch (Exception ex) { Console.WriteLine(ex.Message); // 记录错误 throw ex; // 再次抛出此异常 } }
public static void Register(Type t) { try { COMHelper.RegasmRegisterLocalServer(t); } catch (Exception ex) { Console.WriteLine(ex.Message); // Log the error throw ex; // Re-throw the exception } }