Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors could be returned as object #18

Open
KrzysztofMadejski opened this issue Jan 26, 2015 · 1 comment
Open

Errors could be returned as object #18

KrzysztofMadejski opened this issue Jan 26, 2015 · 1 comment

Comments

@KrzysztofMadejski
Copy link
Contributor

Errors are returned as strings:

CKANJS API Error. HTTP code 409. Message: {
  "help": "http://localhost:5000/api/3/action/help_show?name=package_create",
  "success": false,
  "error": {
    "__type": "Validation Error",
    "id": [
      "Dataset id already exists"
    ]
  }
}

It would be helpful it they were returned as json object:

{ "status": 409,
  "message": {
  "help": "http://localhost:5000/api/3/action/help_show?name=package_create",
  "success": false,
  "error": {
    "__type": "Validation Error",
    "id": [
      "Dataset id already exists"
    ]
  }
}
}

So one can easily check err.message.error.id

@rufuspollock
Copy link
Contributor

Good suggestion though this will be a breaking change. Happy to get a patch and we should bump the version in it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants