Documentation Guide
Breadcrumbs

Error Codes Standardization

Rules

  • Must have message: and message-zh-CHS:

  • Error code name should “codeXxxError”

All error code should follow this format as a standard

    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: "The error code.  \r\n错误代码。"
            message:
              type: string
              description: "The error code's message (in English).  \r\n错误代码的消息(英文)。"
            message-zh-CHS:
              type: string
              description: "The error code's message (in Chinese).  \r\n错误代码的消息(中文)。"

And the example structured as

    codeGeneralError:
      value:
        error:
          code: GeneralError
          message: Server error.
          message-zh-CHS: 服务器错误。