This topic describes only module-specific error codes. For details about universal error codes, see Universal Error Codes.
Error Message
Connect timeout.
Description
This error code is reported if a client connection fails due to a timeout.
Possible Causes
The server does not respond before the timeout.
Solution
Try again after the timeout. If a connection to the remote device exists, disconnect the connection and try again.
Error Message
Peer server is not started.
Description
This error code is reported if the corresponding service on the server is not started.
Possible Causes
The server application failed to start the corresponding service.
Solution
Check whether the corresponding service is started on the target device. If not, start the service and then initiate a connection.
Error Message
The number of servers exceeds the limit.
Description
This error code is reported if the number of services exceeds the limit.
Possible Causes
The number of requested service resources exceeds 10.
Solution
The number of Server resources requested by the application exceeds the maximum allowed number (10). Call the close() method to release these resources.
Error Message
Duplicate server name.
Description
This error code is reported if a service with the same name is registered repeatedly.
Possible Causes
The name of the service being created already exists.
Solution
Check whether a service with the same name already exists. If yes, register the service with a different name.
Error Message
The number of connections exceeds the limit.
Description
This error code is reported if the number of connections exceeds the limit.
Possible Causes
The number of requested connection resources exceeds 10.
Solution
The number of Connection resources requested by the application exceeds the maximum allowed number (10). Call the close() method to release these resources.
Error Message
Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
Description
Invalid parameter.
Possible Causes
A mandatory parameter is not passed.
The parameter type is incorrect.
The number of parameters is incorrect.
A parameter is left empty.
Solution
Check whether the required parameters are passed in and whether the types of the passed parameters are correct. If parameter validation fails, refer to the API reference and check the four possible causes above one by one.
Error Message
Internal error.
Description
An internal error occurs.
Possible Causes
Invalid input device ID.
Invalid input name.
Abnormal internal state.
Incorrect API usage.
System errors, such as null pointer, insufficient memory, unexpected distributed service restart, IPC exception, and JS engine exception.
Solution
View the error log to identify the error cause. Take appropriate based on the actual cause:
Check whether the deviceId passed in is the same as that obtained from the Bluetooth system API, and check whether the peer device is broadcasting.
If the name passed from the client to the server is the same as that passed from the server to the client, check whether the name is correct by referring to the API reference.
Check whether objects are used after being closed.
Check whether the API is correctly used by referring to the API reference.
If the problem persists, restart or update the application or upgrade the device version.