asyncStart(event)


  • 名称:tracing:${name}:asyncStart

    ¥Name: tracing:${name}:asyncStart

asyncStart 事件表示正在到达的可跟踪函数的回调或继续。此时回调参数之类的东西可能可用,或者任何其他表达操作的 "result" 的东西。

¥The asyncStart event represents the callback or continuation of a traceable function being reached. At this point things like callback arguments may be available, or anything else expressing the "result" of the action.

对于基于回调的函数,回调的第一个参数将分配给 error 字段,如果不是 undefinednull,第二个参数将分配给 result 字段。

¥For callbacks-based functions, the first argument of the callback will be assigned to the error field, if not undefined or null, and the second argument will be assigned to the result field.

对于 promises,resolve 路径的参数将分配给 result,或者 reject 路径的参数将分配给 error

¥For promises, the argument to the resolve path will be assigned to result or the argument to the reject path will be assign to error.

建议专门监听 error 事件以跟踪错误,因为可跟踪的操作可能会产生多个错误。例如,失败的异步任务可能会在任务的同步部分抛出错误之前在内部启动。

¥It is recommended to listen specifically to the error event to track errors as it may be possible for a traceable action to produce multiple errors. For example, an async task which fails may be started internally before the sync part of the task then throws an error.