error code
The error code is "seen" by the caller's program, so that developers who develop the caller can accurately and efficiently make an End User-friendly and elegant response based on the error code.
Error codes cannot be thrown directly to End User.
Luwak is an RPC gateway, and the caller may be an API gateway or an iOS or Android client.
Segmentation
The error code returned by Luwak consists of multiple segments:
Serial number | Meaning |
---|---|
Paragraph 0 | Responsible party, who can make adjustments to make the error disappear |
Paragraph 1 | Level 1 Error Type |
Paragraph 2 | Secondary Error Type |
Paragraph 3 | The key to the error, this paragraph may not be |
Responsible party
| Abbreviation | Full name | Scenario example | |-------|------------------|----------------------- -------------------------------------------------- ---| | EU | End User | Unique key conflict: When registering a user, the username already exists. Obviously, this requires End User to register under a new name. No matter how hard others try, they cannot make this error go away | | AD | App Developer | The RPC message is incomplete and the method field is missing. Obviously this is a code problem on the caller's side, and End User can't do anything about it | | SP | Service Provider | JavaScript syntax error, which can only be solved by the Service provider modifying the JS code | | BE | Biz Error | Business errors thrown by JavaScript through returnError (bug: JS may also throw system errors such as failure to call the Alipay interface, which will be regarded as business errors for the time being) | | OPS | Operations | If the database cannot be connected, this must be solved by database operation and maintenance | | Luwak | Luwak Developer | Luwak internal bugs, such as unknown exceptions |
End User (EU)
EU.Validator.DataTypeError
: Zero code zero configuration parameter is mapped to database table column, parameter type does not match the column type defined in the database tableEU.Constraint.PK.NotFound
: When querying, modifying or deleting based on the primary key, the item cannot be foundEU.Constraint.PK.Duplicated
: When inserting or modifying based on the primary key, there are duplicates of the primary keyEU.Constraint.UK.Duplicated
: When inserting or modifying, there are unique key duplicatesEU.Constraint.FK.NotFound
: When querying, inserting, modifying, or deleting, the associated foreign key item cannot be found
Biz Error (BE)
BE.CheckPoint.{ERROR_CODE_FROM_JS}
: No check passed before inserting, updating, or deletingBE.PreDataProcessor.{ERROR_CODE_FROM_JS}
: Data preprocessing error before inserting, updating, or deletingBE.PostAction.{ERROR_CODE_FROM_JS}
: JavaScript returns an error after inserting, updating, deleting, or readingBE.CustomService.{ERROR_CODE_FROM_JS}
: Custom RPC service, JavaScript returns error
App Developer (AD)
AD.ParseError
: Syntax parsing error, the server received invalid json textAD.InvalidRequest
: Invalid request, the server received an invalid request object, for example, it does not comply with the JSON-RPC 2.0 protocol specificationAD.MethodNotFound
: No custom method was found, or the database or table to which this method automatically derives mapping does not exist.AD.MissingParameter
: Missing parameters. Although params are optional, most zero-code zero-configuration requires passing parameters.AD.InvalidParameter
: Invalid parameter, for example, does not comply with the zero-code zero-configuration parameter conventionAD.RequestIdUsed
: The unique request ID is only allowed to be used once within a certain time rangeAD.InvalidTimestamp
: Whether the timestamp differs from the current time of the server by no more than a certain threshold, or does not meet the format requirements
Service Provider (SP)
SP.Script.ParseError
: JavaScript script syntax parsing errorSP.Script.ExecutionError
: JavaScript script luwak.daoSP.Script.Timeout
: JavaScript script timeout error, default timeout is 30 secondsSP.SQL.ParseError
: SQL syntax error, check customized SQLSP.SQL.ExecutionError
: Database execution SQL error, check customized SQL
Operations (OPS)
OPS.LicenseExpired
: License expiredOPS.InvalidLicense
: Invalid licenseOPS.DBConnectError
: DB connection errorOPS.RedisConnectError
: Redis connect errorOPS.MQConnectError
: Message Queue connect error
Luwak Developer (Luwak)
Luwak.Exception
: Luwak internal error