From 9594ecf9b90d639da131556048f9931836676c8f Mon Sep 17 00:00:00 2001 From: h00586870 Date: Tue, 11 Mar 2025 20:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8B=E8=BD=BD=206.0=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BB=BB=E5=8A=A1=E5=A4=B1=E8=B4=A5=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E4=B8=AD=E5=A2=9E=E5=8A=A0=E5=A4=B1=E8=B4=A5=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu-kai45 --- api/@ohos.request.d.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 765fb4a1ef..d3e4504714 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -4639,6 +4639,30 @@ declare namespace request { * @since 12 */ off(event: 'response', callback?: Callback): void; + /** + * Enables the 'fault' callback. + * This callback is triggered when the task failed. + * The returned `Fault` will contain the reason why the task failed. + * + * @param { 'fault' } event - event types. + * @param { Callback } callback - callback function with a `Faults` argument. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters. + *
2. Incorrect parameter type. 3. Parameter verification failed. + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + on(event: 'fault', callback: Callback): void; + /** + * Disables the 'fault' callback. + * + * @param { 'fault' } event - event types. + * @param { Callback } callback - callback function with a `Faults` argument. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Missing mandatory parameters. + *
2. Incorrect parameter type. 3. Parameter verification failed. + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + off(event: 'fault', callback?: Callback): void; /** * Starts the task. * -- Gitee