Update ErrorCode

Signed-off-by: Yangys <yangyousheng@huawei.com>
This commit is contained in:
Yangys 2023-02-17 11:02:26 +08:00
parent d5a36c89d5
commit be5b17ae2a
3 changed files with 56 additions and 0 deletions

View File

@ -99,6 +99,37 @@ declare namespace http {
* @param options Optional parameters {@link HttpRequestOptions}.
* @param callback Returns {@link HttpResponse}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 2300001 - Unsupported protocol.
* @throws {BusinessError} 2300003 - URL using bad/illegal format or missing URL.
* @throws {BusinessError} 2300005 - Couldn't resolve proxy name.
* @throws {BusinessError} 2300006 - Couldn't resolve host name.
* @throws {BusinessError} 2300007 - Couldn't connect to server.
* @throws {BusinessError} 2300008 - Weird server reply.
* @throws {BusinessError} 2300009 - Access denied to remote resource.
* @throws {BusinessError} 2300016 - Error in the HTTP2 framing layer.
* @throws {BusinessError} 2300018 - Transferred a partial file.
* @throws {BusinessError} 2300023 - Failed writing received data to disk/application.
* @throws {BusinessError} 2300025 - Upload failed.
* @throws {BusinessError} 2300026 - Failed to open/read local data from file/application.
* @throws {BusinessError} 2300027 - Out of memory.
* @throws {BusinessError} 2300028 - Timeout was reached.
* @throws {BusinessError} 2300047 - Number of redirects hit maximum amount.
* @throws {BusinessError} 2300052 - Server returned nothing (no headers, no data).
* @throws {BusinessError} 2300055 - Failed sending data to the peer.
* @throws {BusinessError} 2300056 - Failure when receiving data from the peer.
* @throws {BusinessError} 2300058 - Problem with the local SSL certificate.
* @throws {BusinessError} 2300059 - Couldn't use specified SSL cipher.
* @throws {BusinessError} 2300060 - SSL peer certificate or SSH remote key was not OK.
* @throws {BusinessError} 2300061 - Unrecognized or bad HTTP Content or Transfer-Encoding.
* @throws {BusinessError} 2300063 - Maximum file size exceeded.
* @throws {BusinessError} 2300070 - Disk full or allocation exceeded.
* @throws {BusinessError} 2300073 - Remote file already exists.
* @throws {BusinessError} 2300077 - Problem with the SSL CA cert (path? access rights?).
* @throws {BusinessError} 2300078 - Remote file not found.
* @throws {BusinessError} 2300094 - An authentication function returned an error.
* @throws {BusinessError} 2300999 - Unknown Other Error.
*/
request(url: string, callback: AsyncCallback<HttpResponse>): void;
request(url: string, options: HttpRequestOptions, callback: AsyncCallback<HttpResponse>): void;

View File

@ -135,6 +135,8 @@ declare namespace socket {
*
* @param address Destination address. {@link NetAddress}
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
bind(address: NetAddress, callback: AsyncCallback<void>): void;
bind(address: NetAddress): Promise<void>;
@ -144,6 +146,8 @@ declare namespace socket {
*
* @param options Optional parameters {@link UDPSendOptions}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
send(options: UDPSendOptions, callback: AsyncCallback<void>): void;
send(options: UDPSendOptions): Promise<void>;
@ -151,6 +155,7 @@ declare namespace socket {
/**
* Closes a UDPSocket connection.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 201 - Permission denied.
*/
close(callback: AsyncCallback<void>): void;
close(): Promise<void>;
@ -160,6 +165,7 @@ declare namespace socket {
*
* @param callback Callback used to return the result. {@link SocketStateBase}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 201 - Permission denied.
*/
getState(callback: AsyncCallback<SocketStateBase>): void;
getState(): Promise<SocketStateBase>;
@ -169,6 +175,8 @@ declare namespace socket {
*
* @param options Optional parameters {@link UDPExtraOptions}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback<void>): void;
setExtraOptions(options: UDPExtraOptions): Promise<void>;
@ -256,6 +264,8 @@ declare namespace socket {
*
* @param address Destination address. {@link NetAddress}
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
bind(address: NetAddress, callback: AsyncCallback<void>): void;
bind(address: NetAddress): Promise<void>;
@ -265,6 +275,8 @@ declare namespace socket {
*
* @param options Optional parameters {@link TCPConnectOptions}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
connect(options: TCPConnectOptions, callback: AsyncCallback<void>): void;
connect(options: TCPConnectOptions): Promise<void>;
@ -274,6 +286,8 @@ declare namespace socket {
*
* @param options Optional parameters {@link TCPSendOptions}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
send(options: TCPSendOptions, callback: AsyncCallback<void>): void;
send(options: TCPSendOptions): Promise<void>;
@ -281,6 +295,7 @@ declare namespace socket {
/**
* Closes a TCPSocket connection.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 201 - Permission denied.
*/
close(callback: AsyncCallback<void>): void;
close(): Promise<void>;
@ -290,6 +305,7 @@ declare namespace socket {
*
* @param callback Callback used to return the result. {@link NetAddress}
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 201 - Permission denied.
*/
getRemoteAddress(callback: AsyncCallback<NetAddress>): void;
getRemoteAddress(): Promise<NetAddress>;
@ -299,6 +315,7 @@ declare namespace socket {
*
* @param callback Callback used to return the result. {@link SocketStateBase}
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 201 - Permission denied.
*/
getState(callback: AsyncCallback<SocketStateBase>): void;
getState(): Promise<SocketStateBase>;
@ -308,6 +325,8 @@ declare namespace socket {
*
* @param options Optional parameters {@link TCPExtraOptions}.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;
setExtraOptions(options: TCPExtraOptions): Promise<void>;

View File

@ -53,6 +53,8 @@ declare namespace webSocket {
* @param options Optional parameters {@link WebSocketRequestOptions}.
* @param callback Returns callback used to return the execution result.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
connect(url: string, callback: AsyncCallback<boolean>): void;
connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback<boolean>): void;
@ -64,6 +66,8 @@ declare namespace webSocket {
* @param data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
* @param callback Returns callback used to return the execution result.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
send(data: string | ArrayBuffer, callback: AsyncCallback<boolean>): void;
send(data: string | ArrayBuffer): Promise<boolean>;
@ -74,6 +78,8 @@ declare namespace webSocket {
* @param options Optional parameters {@link WebSocketCloseOptions}.
* @param callback Returns callback used to return the execution result.
* @permission ohos.permission.INTERNET
* @throws {BusinessError} 401 - Parameter error.
* @throws {BusinessError} 201 - Permission denied.
*/
close(callback: AsyncCallback<boolean>): void;
close(options: WebSocketCloseOptions, callback: AsyncCallback<boolean>): void;