# Errno error code

Using some Mini programs API / Component, the exception (fail Callback / Promise reject)Error Objects in addition to those with errMsgWith a generic error code errno

Code Examples

wx.openBluetoothAdapter({
  success (res) {
    console.log(res)
  }
  fail (err) {
    console.log(err.errno )
  }
})

# Background

errno The error code appears to solve the following problem:

  • Currently Part API In the event of an error, only the error message is returned errMsg, no error code. The other part API Although there are Errcode, but did not form a uniform format specification.
  • There are currently errCode of API In, different API Returned on failure errCode Different granularity. part API of errCode Too much granularity and not enough information.
  • The same error in a different API in errCode Not aligned, not easy for developers to remember and process.

Therefore, we design a set of error codes with a uniform specificationerrnoTo help developers develop better debugging and handling errors.

errno Error codes have the following advantages:

  • In error code format, has a unified design specification.
  • Different API The corresponding error code is consistent with the same error code in.
  • The error code contains API Category information to help developers locate problems quickly.
  • different API The granularity of error codes in.

when Error Object at the same time errno Error code and errCode Error code,Generally in errno Error code
follow-up errno The error code will be gradually extended to all API Interface, and replace the existing errCode Parameter that provides error information to the developer.

# Error code design

errno The error code is usually 7 Digits, No. 1 - 2 Bit identifier API The first class of interfaces, section 3 - 4 Bit identifier API The Second Level Class of Interfaces, Section 5 - 7 Bit indicates the specific error type.
For example: errno The error code is 1504003 When,15 Express API The first class of interfaces is Equipment,04 Express API The second class of interfaces is NFC,003 Represents a specific error type.
Currently connected. errno of API The categories covered by the interface include:

  • First class category:00 - Universal error code
  • First class category:01 - Basics
    • Secondary Category:00 - Common Base Error
    • Secondary Category:03 - To update
    • Secondary Category:09 - encryption
  • First class category:06 - network
    • Secondary Category:00 - Common Network Error
    • Secondary Category:02 - Initiate a request
    • Secondary Category:03 - to download
    • Secondary Category:04 - upload
    • Secondary Category:06 - mDNS
  • First class category:07 - Pay
    • Secondary Category:00 - Universal Payment Error
    • Secondary Category:01 - Payment Default Level 2 Category
  • First class category:11 - Media
    • Secondary Category:07 - Real-time audio and video
  • First class category:13 - file
    • Secondary Category:00 - Generic file error
    • Secondary Category:01 - File default secondary category
    • Secondary Category:02 - Fd interface
  • First class category:14 - Open interface
    • Secondary Category:16 - WeChat Channels
  • First class category:15 - equipment
    • Secondary Category:00 - Universal Device Error
    • Secondary Category:04 - NFC
    • Secondary Category:05 - Wi-Fi
    • Secondary Category:09 - Bluetooth Low Energy
    • Secondary Category:10 - Bluetooth
  • First class category:20 - AI
    • Secondary Category:02 - Face recognition
    • Secondary Category:03 - vision kit
    • Secondary Category:04 - Machine learning

First-class and second-class names and API The category names of interface documents are generally consistent.

# Best practices

with API interface openBluetoothAdapter For example, when the Bluetooth adapter is not available, the openBluetoothAdapter Exception thrown by the interface Error Object:

"err":
{
	"errMsg": "openBluetoothAdapter:fail:not available",
	"errCode": 10001,
	"errno": 1500102
}

You can do exception handling with the following code:

wx.openBluetoothAdapter({
  success (res) {
    console.log(res)
  },
  fail (err) {
    // WeChat can not use Bluetooth, can guide the user to enable Bluetooth in the system settings
    if ( err.errno  === 1500102 ) {
        wx.showModal({
            content: WeChat cannot use Bluetooth, please go to the system settings to enable it.
        })
    }
  }
})

# Error Code List

The following are errno A list of values.

errno errMsg meaning
0 ok success
1 cancel Revoke
3 system permission denied System permissions are not granted to WeChat
4 internal error Small frame internal exception
5 Time out Interface timeout
100 jsapi not supported JsApi does not support
101 jsapi invalid request Data JsApi request parameter is illegal
102 jsapi has no permission JsApi does not have permission
103 jsapi user authorize denied JsApi User Denied Authorization
104 jsapi user authorize canceled JsApi user deauthorization
106 invalid jsapi index JsApi permission bit number illegal
108 cgi failed for network issues Network error causes CGI logic to fail
109 cgi failed for response null CGI response is empty
110 scope or scope list empty Scope or scope list is empty
111 oom occurs OutOfMemoryError
112 api scope is not declared in the privacy agreement Interface is not stated in the privacy agreement
1000 server system error Server System Error
1001 invalid request Parameter Base library wx interface request parameter illegal
1002 empty request Empty request
1003 meet server frequency limit Hit Server Frequency Limit
1004 invalid Openid Illegal openid
1005 invalid appid Illegalappid
1006 insert Data failed Failed to add data
1007 get no Data Data does not exist
1008 update Data failed Failure to update data
1009 Data expired Data expiration
1010 Data deleted Data deleted
1011 invalid user id Illegal user identity
1012 api need post method API requires post request
1013 api need get method Api requires get requests
1014 invalid user ticket Invalid credentials
1015 invalid api Invalid interface
1016 no WebSocket conn Info No websocket connection information
1017 mem err Server-side memory related errors
1018 duplicated uuid Uuid conflict
1019 not friend Not a friend relationship.
1020 Code already used Code is used.
1021 Code expired Code Expired
1022 invalid json JSON data parsing error
1023 invalid state Invalid state
1024 invalid plugin appid Illegal plugin appid
1025 wxa appid privacy api banned The Mini Program privacy interface is blocked,Solutions Reference Links
1026 wxgame appid privacy api banned Small game privacy interface is blocked,[Solutions Reference Links](https://developers.weixin.qq.com/community/Minigame /doc/0004c84925817819b7ffd8b2356008)
100001 json parse error JSON parsing error
101100 Interface is not declared in the privacy agreement Interface is not stated in the privacy agreement
101101 privacy Interface is banned Privacy interface blocked
101102 privacy permission is not authorized User does not agree to the privacy policy
102101 settings Page not found OpenSystemSettings Can't Find Corresponding Tie Settings Page
103101 ApplyUpdate has Been called AppleUpdate has been called
103102 update is not ready Update is not ready to complete
109001 invalid random value length Invalid random number length
500001 invalid style Invalid style
505101 Require absolute path Absolute path required
510001 invoke too frequently Function call interval too short
510101 invalid text Invalid text
600000 unknown network error Unknown network error
600001 Cronet component error Cronet component error, refer to the errMsg field in the return for details. referenceCronet source code net_error_list or net_error_list
600002 url not in Domain list The url domain name is not in the list of secure domains
600003 network interrupted error The network was interrupted. The following two conditions can cause this error: 1. Initiate a network request while the Mini Program is in the background2. After the Mini Program initiates the network request in the foreground, it retreats to the background, and the request fails to return to the background. 5s Inside at the end.
600004 network logic error Network category logic error
600005 network argv error Network category parameter error
600006 network system error Network Category System Error
600007 network exceed max task count Exceeding maximum number of requests
600008 network reach the max redirect count Exceeded maximum number of redirects
600009 invalid URL URL Format is not legal
600010 invalid request Data Requested Data Serialization failure
600011 url validate error URL Validation Error
602000 unknown network request error Unknown origin request error
602001 request system error Request System Error
602002 request server http error HTTP request httpdns server error
602101 not buy httpdns service Mini Programs do not buy httpdns services in the service market
602102 service expired Mini Programs in httpdns service market resource pack expired
602103 no enough httpdns quota Mini Program is insufficient in the httpdns service market
602104 empty servicer return The httpdns provider returned an empty result
602105 time-out when request servicer Calling httpdns provider results in timeout
602106 invalid servicer response HTTPDNS provider returns data illegally
602107 empty Domain httpdns result The result is empty.
602108 not valid service id Unsupported httpdns provider id
602300 convert native buffer Parameter fail. native buffer exceed Size limit Beyond native Maximum buffer limit
602301 bind socket dependency is unavailable Request for mobile network failed
602302 response Data convert to UTF8 fail Request data conversion format failed
603101 iOS not supported Does not support the iOS platform
603102 android not supported Does not support Android platform
603103 Parameter error: Require packageName or packageNameArray Package name or package name array required
603104 Parameter error: Require downloadId or downloadIdArray or appIdArray Need to download ID or ID array or APPID array
603105 abort download task Interrupt download task
603300 download save File error Error saving file
603301 exceed max File Size Maximum file size limit exceeded
603302 File Data is empty File data is empty
603303 permission denied can not open File filepath Specify storage path without permission
605103 WebSocket connect is fail WebSocket Connect failed
606101 mdns resolve system error:%d Parse failed. Refer to errMsg field in return for detailed error.[System Error Code Reference Link](https://developer.android.com/Reference/android/net/nsd/NsdManager #constants_1)
700000 unknown payment error
700001 limited use Vest WeChat intercept payment interface
701000 unknown payment default class error
701001 ios not support
701002 need realname verify Before payment
701100 midas buy goods failed Master Rice failed.
701101 midas get account balance failed Master Mi failed to check the account amount
701102 midas currency pay failed Master Meter Token Payment Failure
701103 midas currency canel pay failed Rice Master Token Refund Failure
701104 midas currency present failed Master Rice Gift Token Failure
701105 midas get user Water failed Meter master pull the user water failed
701106 midas currency in sufficient Master Rice Token Balance Insufficient
701107 midas order not exists Master Meter Order does not exist
701108 midas order already refunded Rice Master Order Refunded
701109 midas order refunded amount exceed Master Rice Token Refund Amount Exceeds Limit
701110 midas order duplicated pperator Payment duplication
701111 midas invalid Parameter Parameter error
701112 midas get coupons failed Master Rice failed to pull the voucher
701113 midas get set coupon order failed Master Rice failed to record voucher information when ordering
701114 midas no valid coupons Master Rice does not have a valid voucher
701115 midas order alreay paid Rice Master Order Paid
701116 midas no valid rollback coupon Rice Master No Corresponding Rollback Voucher
702001 invalid Parameter Parameter error
702002 invalid signature User Mode Signature Error
702003 invalid pay signature Payment Signature Error
702004 invalid mode The payment model is illegal.
702005 out_trade_no repeated, please Change Merchant Order Number Repeat
702006 mch is not registered The buyer is not finished. Cannot place an order
702007 user unauthorized The user is not authorized, Cannot place an order
702008 can not use sandbox in Release version Online version of the Mini Program can not be used in a sandbox environment
1103002 target File not exists The target image does not exist.
1103003 image decode fail Image decoding failure
1103004 create temp File fail Temporary file creation failed
1103005 error occurs During the compress process Error occurred during image compression
1103006 param compress quality invalid Quality illegal (<0 or >100)
1103007 src image File Size Zero Picture is zero in length or width
1107001 Users are currently watching live/Video call/to make a telephone call
1107002 Currently in RTC mode, but the user did not grant WeChat recording permission
1107003 illegal operation in background Mini Program back to the background cannot operate
1107004 Take snapshot fail Screenshot failed
1107005 save to album after Take snapshot fail Failed to save to album after screenshot
1107006 save to temp File after Take snapshot fail Failed to save to temporary file after screenshot
1107007 not in picture in picture mode now video/The live-player component is not currently in small window mode
1107008 exiting picture in picture mode now video/The live-player component is currently exiting small window mode
1107009 request background playback but src empty Src is empty when entering background audio playback mode
1107010 request background playback but in rtc mode Background audio playback mode is not allowed in rtc mode
1107011 request background playback but in background The page is already in the background, not allowed to enter the background audio playback mode
1107012 load resource File fail Source file loading failed
1107013 system permission denied Ready to push the stream, but the user did not grant WeChat recording/Camera permissions
1300001 Operation not permitted Operation is not allowed
1300002 No such File or directory File or directory not found
1300005 Input/output error Input output stream not available
1300009 Bad File descriptor Invalid fd
1300013 Permission denied Permission error, file is read-only or write-only
1300014 Path permission denied The incoming path does not have permission
1300020 Not a directory The specified path is not a directory, often in the case where the parent of the specified write path is a file
1300021 Is a directory Specifies that the path is a directory
1300022 Invalid argument Invalid argument, you can check whether length or offset is out of bounds
1300036 File Name too long File name too long
1300066 Directory not empty Directory is not empty
1300201 system error Failed system interface call
1300202 the maximum Size of the File storage limit is exceeded Insufficient storage space
1300203 Encode error Character encoding conversion failed
1300300 sdcard not mounted sd Card mount failed
1300301 unable to open as fileType Unable to open file as fileType
1301000 permission denied, cannot access File path Destination path has no access right (usr directory)
1301002 Data to write is empty Write data empty
1301003 illegal operation on a directory You cannot do this on a directory
1301004 illegal operation on a package directory You cannot do this with the code package directory
1301005 File already exists Already have a file or directory with the same name
1301006 value of length is out of Range Length value out of bounds
1301007 value of offset is out of Range Offset value out of bounds
1301008 fd argument must be of type number The value of the fd parameter must be of type number
1301009 value of position is out of Range Position value out of bounds
1301100 store directory is empty Store directory is empty
1301102 unzip open File fail Compressed file opening failure
1301103 unzip entry fail Failed to extract single file
1301104 unzip fail Decompression failure
1301111 brotli decompress fail Brotli Decompression Failure (iOS exclusive)
1301112 tempFilePath File not exist The specified tempFilePath cannot find the file
1302001 permission denied, fd is writeonly or readonly Fd read-only/Write only
1302002 excced max concurrent fd limit The number of fd has reached the limit
1302003 invalid flag Invalid flag
1302004 permission denied when open using flag Unable to open file with flag
1302005 array buffer does not exist Not passed in arrayBuffer
1302100 array buffer is readonly ArrayBuffer Read-Only
1400001 appid no enough quota Mini Program quota balance is insufficient
1402101 wxa Login is blocked The Mini Program is blocked.
1416100 invalid Finder username Illegal WeChat Channelsid
1416101 get Finder Info failed Pulling WeChat Channels information failed
1416102 invalid Finder feed id Illegal feed._id
1416103 not Same contractor Mini Program appid and WeChat Channels do not pass the same subject check
1416104 empty Finder Info WeChat Channels got empty data
1416105 get partially visible Finder Info WeChat Channels captures data that is only visible to some people
1416106 invalid Finder Token Illegal WeChat Channelstoken
1416107 appid Token no permission WeChat Channels account closing Mini Programs token reference
1416108 parse Token failed Failed to parse token
1416109 user Token hit spam limit Hit Risk Control Limit When User Resolves Token
1420103 not Same contractor Appid and enterprise WeChat with the main verification does not pass
1421102 user getPhoneNumber is blocked User access to mobile phone number is blocked
1500101 not init Uninitialized Bluetooth Adapter
1500102 Current Bluetooth Adapter Not Available
1500103 The current BLE device is not getting the service/Cannot get a Service with the corresponding UUID
1500104 Failed to invoke system Bluetooth capability See errMsg for detailed errors
1500105 system not support System does not support BLE
1504001 The system does not support NFC
1504002 not support HCE The system does not support HCE
1504003 system NFC switch not opened System NFC switch not turned on
1504100 not set default NFC application No NFC default app set
1504101 register aids failed HCE failed to register aid list
1504200 user is not authorized The user does not authorize the app to use NFC capabilities
1504201 parse NdefMessage failed Parsing NdefMessage failed
1504202 NFC discovery already started Already called startDiscovery earlier
1504203 NFC discovery has not started Did not call startDiscovery before
1504204 Tech already connected Tech is already connected.
1504205 Tech has not connected Tech is not connected yet.
1504206 NFC tag has not Been discovered NFC tag not found
1504207 invalid tech Ineffective tech
1504208 unavailable tech Current NFC tags do not support this tech
1504209 function not support This NFC capability is not supported
1504210 system internal error Failed to invoke system NFC capability, See errMsg for detailed errors
1505000 unknown WIFI error
1505001 not invoke startWifi StartWifi is not called
1505002 Wifi is disabled System WiFi switch not on
1505003 maybe not open GPS Operation failed, Probably because the system GPS switch is not turned on
1505004 maybe not obtain GPS Permission Operation failed, Probably because the user did not grant the app location permission
1505005 currentWifi is null Can't get currently connected WiFi
1505006 current connected Wifi is invalid The currently connected WiFi information obtained is illegal, Developers can consider retrying
1505020 unknown error Connecting WiFi Other Unknown Errors
1505021 weapp in background Small programs in the background, Not allowed to call connectWifi
1505022 open settings fail Only Android, Jump System Settings page Jump failed
1505023 duplicated request Repeat WiFi connection
1505024 password error Password Error
1505025 Wifi config may be expired The WiFi configuration may have expired
1505026 fail to connect wifi:time out Connect WiFi timeout
1505027 user denied User Denied Authorization to Connect to Wi-Fi
1505028 Weixin cannot modify system config Only iOS, System/Operator configured to refuse to connect to Wi-Fi
1505029 invalid ssid IOS only, invalid ssid
1505030 duplicate request Only iOS, the last request has not been completed, repeat the request
1505031 invalid WEP / WPA password IOS only, invalid WEP/WPA password
1505032 system internal error System error, need to print more information in errMsg
1505040 Failed to get currently connected WiFi, Developers can consider trying again later
1509000 unknown BLE error
1509001 Failed to connect BLE device
1509002 Current Service does not get Characteristic/Cannot get a Characteristic corresponding to a UUID
1509003 The BLE device is not connected
1509004 This attribute is not supported by the current Characteristic, see errMsg for more details
1509005 BLE operation timeout
1509006 device not found Equipment not found
1509007 already connect The current BLE device is already connected
1509008 location permission is denied Android6.0 or above, BLE scan requires authorized geographic location
1509010 wait for bluetooth state Change timeout Client wait state update timeout after call to openBlueTooth Adapter on iOS
1510101 need pin Pairing the current Bluetooth device requires a pin
1510102 reach max bluetooth background count The number of devices supporting Bluetooth backend communication has reached the limit
1517001 the content of the text message exceeds the limit Text message content exceeds length limit
2000000 AI system error System error
2000001 AI invalid arguments Parameter error
2000002 AI client device not supported Client device not supported
2000003 AI os not supported The system does not support
2000004 AI library not supported Client device not supported
2002000 unknown error Unknown error
2002001 Face detection does not initialize Face detection not initialized
2002002 Face detection has duplicated initialization Face detection repeated initialization
2002003 Face detection has failed initialization Face detection initialization failure
2002004 Face not detected or detection failed No face detected or failed detection
2002005 stop Face detection failed Stop face detection failure
2003000 session unavailable Session not available
2003001 system Camera not authorized System camera permissions are not open
2003002 Camera not authorized Mini Program camera permissions not authorized
2004000 model path invalid : %s Illegal model file path
2004001 create session fail : %s Failed to create session through sdk
2004002 sessionId is empty session id Empty
2004003 input tensors is empty input tensors Empty
2004004 Data type [%s] for input tensor [%s] is unsupported Current input data type is not supported
2004005 invalid session id Invalid sessionId
2004006 Data type [%s] for output tensor [%s] is unsupported Current output data type is not supported
2004007 input tensor [%s] Data is invalid : %s input Tensor data is empty
2004008 input tensor has invalid Shape : %s Invalid shape
2004009 run session fail(%s) Via sdk run Session failure
2004010 environment not ready Environment is not ready(Like Android So not loaded)
2004011 session id not exist Released session Id does not exist
2004012 the input tensor [%s] MUST have %s attribution Input Tensor Missing Property