# Errno error code

When using part of the Weixin Mini Program API / component, the exception thrown (fail callback / Promise reject)Errorobject with the exception of `` errMsg, with a generic error codeerrno`.

Code examples

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

# Background Introduction

The errnoerror code appears to solve the following problems:

  • At present, some APIs only return the error messageerrMsgwhen an error occurs, no error code.Another part of the API, although errCode, but no unified format specification.
  • Among the current errCode APIs, different APIs return errCode granularity when they fail. The errCode granularity of some APIs is too large and not enough information.
  • The same error in different API errCode misaligned, not easy for developers to remember and deal with.

Therefore, we have designed a set of error codes with a unified specificationerrnoto help developers better develop, debug and handle errors.

The errnoerror code has the following advantages:

  • There is a uniform design specification for the error code format.
  • The same error occurs in different APIs, and the corresponding error code is the same.
  • The error code contains API category information to help developers quickly locate problems.
  • The error code granularity in different APIs is more uniform.

When theErrorobject containserrnoError codes anderrCodeWhen an error code is made, generally takes precedence overerrnoerror code .

A subsequenterrnoerror code will gradually be extended to all API interfaces and replace the existingerrCodeparameter to provide developers with error messages.

# Error code design

ErrnoError codes are typically seven bits, with bits 1 - 2 identifying the first class of the API interface, bits 3 - 4 identifying the second class of the interface, and bits 5 - 7 indicating the specific error type.

Example:errnoerror code is1504003When``15indicates that the first class of the API interface is Device,04indicating that the second class of theAPI interface is DevicesNFC,003denotes specific error types.

The categories of API interfaces that have been accessed toerrnoinclude:

  • Level 1 category:00- generic error code
  • Level 1 category:01- Basic
    • Level 2 category:00- General Base Errors
    • Category II:03- Updated
    • Level 2:09- Encryption
  • Level I category:06- Network
    • Level 2 category:00- General network errors
    • Level 2 category:02- Initiate request
    • Level 2 category:03- Download
    • Level 2:04- Upload
    • Level 2 category:06- mDNS
  • Level 1 category:07- Payment
    • Category II:00- Universal Payment Errors
    • Secondary category:01- Payment default secondary category
  • Level 1 category:11- Media
    • Level 2 category:07- Real time audio and video
  • Category I:13- Documents
    • Level 2 category:00- Common file errors
    • Secondary category:01- File default secondary category
    • Level 2:02- fd interface
  • Level 1 category:14- Open interfaces
    • Secondary category:16- WeChat Channels
  • Level 1 category:15- Equipment
    • Level 2 category:00- General Equipment Error
    • Level 2 category:04- NFC
    • Level 2 category:05- Wi-Fi
    • Level 2 category:09- Bluetooth Low Energy
    • Level 2 category:10- Bluetooth ®
  • Level 1 category:20- AI
    • Level 2 category:02- Face recognition
    • Level 2:03- vision kit
    • Level 2 category:04- Machine learning

The first class name is basically the same as the second class name and the class name of the API interface document.

# Best practices

In the case of the API interfaceopenBluetoothAdapter, for example, an exceptionErrorobject is flushed for theopen BluetoothAdapterinterface when the Bluetooth adapter is not available:

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

An exception can be handled by the following code:

wx.openBluetoothAdapter({
  success (res) {
    console.log(res)
  },
  fail (err) {
    // 微信无法使用蓝牙,可引导用户在系统设置中启用蓝牙
    if ( err.errno === 1500102 ) {
        wx.showModal({
            content: '微信无法使用蓝牙,请到系统设置中启用'
        })
    }
  }
})

# List of Error Codes

Here is a glance at theerrnovalues.

errno errMsg meaning
0 ok success
1 cancel Revoke
3 system permission denied System permission not granted WeChat
4 internal error Weixin Mini Program Framework 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 Interfaces not declared in privacy protocols
1000 server system error A 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 the server frequency limit
1004 invalid openid Illegal openid
1005 invalid appid Illegal AppID
1006 insert data failed Adding data failed
1007 get no data The data does not exist
1008 update data failed Update data failed
1009 data expired Data is out of date
1010 data deleted The data was deleted
1011 invalid user id Illegal user identity
1012 api need post method The API requires a post request.
1013 api need get method API requires get requests
1014 invalid user ticket An invalid certificate
1015 invalid api An invalid interface
1016 no websocket conn info No websocket connection information
1017 mem err Service-side memory-related errors
1018 duplicated uuid Uuid conflict
1019 not friend It's 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 Status of invalidity
1024 invalid plugin appid AppID
1025 wxa appid privacy api banned Weixin Mini Program Privacy Interface Blocked, Solution Reference Link
1026 wxgame appid privacy api banned MiniGame Privacy Interface Blocked, Solution Reference Link
1032 invalid signature The signature is invalid
1033 data size not match List data length does not match
1034 same user It's the same user
1035 not wechat user Non WeChat user
1036 invalid username Illegal username
100001 json parse error JSON parsing error
101100 interface is not declared in the privacy agreement Interfaces not declared in privacy protocols
101101 privacy interface is banned The privacy interface is blocked.
101102 privacy permission is not authorized The user did not agree to the authorized privacy agreement
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 The length of invalid random numbers
500001 invalid style Invalid style
505101 require absolute path An absolute path is needed.
510001 invoke too frequently Function call interval too short
510101 invalid text Invalid text
600000 unknown network error Unknown network errors
600001 cronet component error Cronet component error. Refer to errMsg field in return for details.Reference cronet source 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 forced to shut down.The following two conditions can cause this error: 1. Network requests are made while Weixin Mini Program is in the background; 2. After the Mini Program initiates the network request in the foreground, it retreats to the background, and the request fails to end within 5 s after the background.
600004 network logic error Network category logical error
600005 network argv error Network category parameter error
600006 network system error Network category system error
600007 network exceed max task count Over the maximum number of requests
600008 network reach the max redirect count More than the maximum number of redirections
600009 invalid URL URL – The format is invalid.
600010 invalid request data Requested data serialization failed
600011 url validate error URL Validation error
602000 unknown network request error An unknown originating request error
602001 request system error Request System Error
602002 request server http error HTTP request httpdns server error
602101 not buy httpdns service Weixin Mini Program Not purchasing httpdns service in the service market
602102 service expired Weixin Mini Program Expired in the httpdns service marketplace resource pack
602103 no enough httpdns quota Weixin Mini Program Insufficient quota in 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 Exceeding native buffer maximum
602301 bind socket dependency is unavailable Request for a mobile network failed
602302 response data convert to UTF8 fail Request for data format failed
603101 iOS not supported Does not support the iOS platform
603102 android not supported Not supported on the Android platform
603103 parameter error: require packageName or packageNameArray A package name or package name array is required
603104 parameter error: require downloadId or downloadIdArray or appIdArray Need to download ID or ID array or APPID array
603105 abort download task Interrupting the download task
603300 download save file error An error in saving the file
603301 exceed max file size Exceeding the file maximum size limit
603302 file data is empty The file data is empty
603303 permission denied can not open file filepath Specify a storage path without permission
605103 WebSocket connect is fail WebSocketconnect failed
606101 mdns resolve system error:%d Parse failed. Refer to errMsg field in return for detailed error. System error code reference link
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 Mi made a failed order.
701101 midas get account balance failed MiMaster query account quota failed
701102 midas currency pay failed Mi Master Token Payment Failed
701103 midas currency canel pay failed Mi Master Token Refund Failed
701104 midas currency present failed Mi Master Gift Token Failed
701105 midas get user water failed Mutil failed to pull a user's stream
701106 midas currency in sufficient The Midas token balance is insufficient
701107 midas order not exists The Mi Master order does not exist.
701108 midas order already refunded My Master order has been refunded
701109 midas order refunded amount exceed The Midas token refund amount exceeded the upper limit
701110 midas order duplicated pperator Repeated payment operations
701111 midas invalid parameter Parameter Error
701112 midas get coupons failed Master Miller failed to get a voucher.
701113 midas get set coupon order failed Mi Master failed to record voucher information when placing an order
701114 midas no valid coupons Master Me has no valid voucher
701115 midas order alreay paid My Master Order Has Been Paid
701116 midas no valid rollback coupon Master Me doesn't have a voucher to roll back.
702001 invalid parameter Parameter Error
702002 invalid signature User status signing error
702003 invalid pay signature Payment Signature Error
702004 invalid mode The payment model is not legal.
702005 out_trade_no repeated, please change The merchant's order number is duplicated
702006 mch is not registered The merchant has not finished the item and cannot place the order
702007 user unauthorized The user is not authorized, cannot place an order
702008 can not use sandbox in release version On-line version Weixin Mini Program can not be used in sandbox environment
703001 user disable globalpay The user was unable to use the global cash register service
703002 user cancel picker Select Panel: User Cancel
703003 already picked Select Panel: Users have selected, no need to repeat calls
703004 load picker timeout Select Panel: Turn on timeout
703005 picker already open Select Panel: Opened
703006 user unpicked payment method The user has not selected a payment method, please call openMethodPicker first
703007 requestGlobalPayment already end The payment has ended.
703008 input info error Error in the incoming order information
703009 input info is inconsistent with the user's selection The payment method corresponding to the incoming order information is inconsistent with the user's choice
703010 open paypage error Unable to open the payment page
703011 call abort The payment process is interrupted by calling the abort interface.
703012 request timeout Timeout without calling requestGlobalPayment
703013 request end The payment ends, but there is no way to tell if the user made a successful payment.
703014 user unpicked payment method The user has not selected a payment method, please call openMethodPicker first
703015 requestGlobalPayment already end The payment has ended.
703016 user is paying The user is in the payment page
1103002 target file not exists The target image does not exist
1103003 image decode fail Image decoding failed
1103004 create temp file fail A temporary file creation failed
1103005 error occurs during the compress process An error occurred in the process of compressing the picture
1103006 param compress quality invalid Quality Illegal (< 0 or > 100)
1103007 src image file size zero The picture is zero in length or width
1107001 Users are currently watching live / video call / call
1107002 Currently in rtc mode, but the user has not granted WeChat recording permission
1107003 illegal operation in background Weixin Mini Program Unable to operate when backstage
1107004 take snapshot fail Screenshot failed
1107005 save to album after take snapshot fail Save to album after screenshot failed
1107006 save to temp file after take snapshot fail Save to temporary file after a screenshot failed
1107007 not in picture in picture mode now video / live-player component is not currently in small window mode
1107008 exiting picture in picture mode now video / 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 stream, but the user did not grant WeChat recording / photographing permission
1300001 Operation not permitted The operation is not allowed.
1300002 no such file or directory Could not find a file or directory
1300005 Input/output error The input and output stream is 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 has no permissions.
1300020 Not a directory The specified path is not a directory, commonly when the higher-level path of the specified write path is a file
1300021 Is a directory The specified 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 The file name is too long.
1300066 Directory not empty The directory is not empty
1300201 system error System interface call failed
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 Failed to mount sdcard
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 to 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 on the code package directory
1301005 file already exists There are already files or directories of 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 The compressed file failed to open
1301103 unzip entry fail Unpacking a single file failed
1301104 unzip fail The decompression failed.
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 / 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 Weixin Mini Program quota is insufficient
1402101 wxa login is blocked Weixin Mini Program Login blocked
1416100 invalid finder username Illegal WeChat Channelsid
1416101 get finder info failed Failed to retrieve WeChat Channel information
1416102 invalid finder feed id Illegal feed_id
1416103 not same contractor Weixin Mini Program AppID and the subject-based verification with WeChat Channels do not pass
1416104 empty finder info The data obtained from WeChat Channels is empty.
1416105 get partially visible finder info The data obtained through WeChat Channels is only visible to a select group of individuals.
1416106 invalid finder token Illegal WeChat Channelstoken
1416107 appid token no permission WeChat Channels account deactivated Weixin Mini Program 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 Weixin Mini Program AppID and enterprise WeChat failed the same subject check
1421102 user getPhoneNumber is blocked Users' ability to obtain mobile phone numbers is blocked
1500101 not init The Bluetooth Adapter was not initialized
1500102 The current Bluetooth adapter is not available
1500103 The current BLE device cannot get the service / cannot get the service corresponding to the UUID
1500104 Failed to invoke system Bluetooth capability, see errMsg for details
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 details
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, possibly because the system GPS switch is not turned on
1505004 maybe not obtain GPS Permission The operation failed, possibly 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, the developer may consider retrying
1505020 unknown error Connecting WiFi Other Unknown Errors
1505021 weapp in background Weixin Mini Program in the background, not allowed to call connectWifi
1505022 open settings fail Only Android, Jump Link Settings page in case of jump failure
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 For iOS only, the system / carrier configuration refuses 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 may consider retrying later
1509000 unknown BLE error
1509001 Failed to connect BLE device
1509002 The current Service cannot get a Characteristic / Cannot get a Characteristic for the corresponding UUID
1509003 The BLE device is not connected
1509004 Current Characteristic does not support this attribute, see errMsg for details
1509005 BLE operation timeout
1509006 device not found No equipment was found
1509007 already connect The current BLE device is already connected
1509008 location permission is denied Android6.0 or above, BLE scanning 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 back-end communication has reached an upper limit
1517001 the content of the text message exceeds the limit Text content exceeds length limit
2000000 AI system error A system error
2000001 AI invalid arguments Parameter Error
2000002 AI client device not supported Client devices do not support this
2000003 AI os not supported The system does not support it
2000004 AI library not supported Client devices do not support this
2002000 unknown error unknown error
2002001 face detection does not initialize Face detection was not initialized
2002002 face detection has duplicated initialization Repeated initialization of face detection
2002003 face detection has failed initialization Face detection initialization failed
2002004 face not detected or detection failed Faces cannot be detected or detection fails
2002005 stop face detection failed Stop face detection failure
2003000 session unavailable The session is not available
2003001 system camera not authorized System camera permissions are not turned on
2003002 camera not authorized Weixin 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 is empty
2004003 input tensors is empty Input tensors are 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) Failed via sdkrunsession
2004010 environment not ready The environment is not ready (for example, Androidso is not loaded)
2004011 session id not exist The session id released does not exist
2004012 the input tensor [%s] MUST have %s attribution Input dimension missing attribute