This section describes only module-specific error codes. For details about universal error codes, please refer to Universal Error Codes.
Message
Description
This error code is reported when an algorithm exception occurs.
Possible causes
An algorithm exception occurs during barcode image generation or image-based barcode recognition.
Solution
Call the barcode image generation or image-based barcode recognition API again.
Message
Internal error. Failed to create pixelMap.
Description
This error code is reported when the pixelMap fails to be created during barcode image generation.
Possible causes
The image creation logic is abnormal.
Solution
Call the barcode image generation API again.
Message
Internal error. Failed to read file.
Description
This error code is reported when a file fails to be read.
Possible causes
The input URI is invalid.
Solution
Check the URI passed.
Message
Description
This error code is reported when the system context fails to be obtained.
Possible causes
The context passed in is incorrect.
Solution
Check the context input parameter.
Message
Internal error. Get callback failed.
Description
This error code is reported when the callback fails to be obtained.
Possible causes
The callback passed in is abnormal.
Solution
Check the callback input parameter.
Message
Internal error. Permission error.
Description
This error code is reported when a permission error occurs.
Possible causes
The app does not have the camera permission.
Solution
Apply for the camera permission in module.json5 and code.
Message
Description
This error code is reported when the API call sequence is incorrect.
Possible causes
APIs are not called in the correct sequence. For example, the customScan.start API is called before customScan.init.
Solution
Adjust the sequence for calling APIs. For example, call the customScan.init API first and then the customScan.start API.
Message
Internal error. The interface can't be used in promise interface.
Description
This error code is reported when the API is called using a promise in customScan.start.
Possible causes
The customScan.rescan API is called using a promise in customScan.start.
Solution
Call the customScan.rescan API using a callback in customScan.start.
Message
Internal error. The width and height of viewcontrol do not match the width and height supported by the camera.
Description
This error code is reported when the aspect ratio of the ViewControl does not match the camera resolution.
Possible causes
The aspect ratio of the ViewControl does not match the camera resolution.
Solution
Check the aspect ratio of the ViewControl.
Message
Description
This error code is reported when a camera error occurs.
Possible causes
Solution
Create the service again.
Message
The user canceled the barcode scanning.
Description
This error code is reported when a user cancels scanning.
Possible causes
The user tapped the close button or swiped back to cancel scanning.
Solution
This error code is reported in the scenario where scanBarcode.startScanForResult is called. Handle the subsequent business process after a user cancels scanning.