what is the better way to handle errors in VB6

前端 未结 7 711
再見小時候
再見小時候 2020-11-30 06:43

I have VB6 application , I want to put some good error handling finction in it which can tell me what was the error and exact place when it happened , can anyone suggest th

7条回答
  •  萌比男神i
    2020-11-30 07:30

    a simple way without additional modules, useful for class modules:

    pre-empt each function/subs:

    On Error Goto Handler
    

    handler/bubbleup:

    Handler:
      Err.Raise Err.Number, "(function_name)->" & Err.source, Err.Description
    

    voila, ghetto stack trace.

提交回复
热议问题