Skip to content

errorCode is expected to be a string, but objects may be return #27

Open

Description

@stelcheck
{
    "errorCode" :
    {
        "actual" : "undefined",
        "expected" : "string",
        "message" : "invalidPassword",
        "name" : "AssertionError",
        "operator" : "=="
    }
}

@ronkorving @MiLk is this something we should expect from the server? Or is this not valid?

Activity

  1. MiLk commented on Jul 28, 2014

    @MiLk
    Contributor

    errorCode should never be an object. Or the name should be changed.

    The jsonrpc spec provides an error object http://www.jsonrpc.org/specification#error_object
    Currently the errorCode returned by MAGE is a string, and it's not compatible with the spec, but we can follow the same structure to return the errors:

    {
      "error": {
        "code": "simple string",
        "message": "long string",
        "data": {}
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions