Page MenuHomePhabricator

Api error for account creation has numerical error codes when there are multiple errors
Open, Needs TriagePublic

Description

Examples

Example with more than one block

{
    "createaccount": {
        "status": "FAIL",
        "message": <message>,
        "messagecode": "___1____2____3____4",
        "canpreservestate": false
    }
}

The numbers seem to correspond to how many blocks make up the composite block.

A single block returns "messagecode": "blocked"

Example with more than one password error

Creating an account with password "foobar":

{
    "createaccount": {
        "status": "FAIL",
        "message": "* Passwords must be at least 8 characters.\n* The password entered is in a list of very commonly used passwords. Please choose a more unique password.",
        "messagecode": "___1____2",
        "canpreservestate": false
    }
}

(Also from @dom_walden)

What's the problem?

This seems to be caused by the following:

Similar task

T167163: API error response for list=user&usprops=cancreate with similar username has '$1' instead of real error code.