{"action":"created","issue":{"url":"https://api.github.com/repos/Mashape/kong/issues/55","labels_url":"https://api.github.com/repos/Mashape/kong/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/Mashape/kong/issues/55/comments","events_url":"https://api.github.com/repos/Mashape/kong/issues/55/events","html_url":"https://github.com/Mashape/kong/issues/55","id":59889167,"number":55,"title":"Inconsistent error messages from DAO","user":{"login":"thefosk","id":964813,"avatar_url":"https://avatars.githubusercontent.com/u/964813?v=3","gravatar_id":"","url":"https://api.github.com/users/thefosk","html_url":"https://github.com/thefosk","followers_url":"https://api.github.com/users/thefosk/followers","following_url":"https://api.github.com/users/thefosk/following{/other_user}","gists_url":"https://api.github.com/users/thefosk/gists{/gist_id}","starred_url":"https://api.github.com/users/thefosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefosk/subscriptions","organizations_url":"https://api.github.com/users/thefosk/orgs","repos_url":"https://api.github.com/users/thefosk/repos","events_url":"https://api.github.com/users/thefosk/events{/privacy}","received_events_url":"https://api.github.com/users/thefosk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mashape/kong/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Mashape/kong/milestones/2","html_url":"https://github.com/Mashape/kong/milestones/0.1.0-beta","labels_url":"https://api.github.com/repos/Mashape/kong/milestones/2/labels","id":958979,"number":2,"title":"0.1.0-beta","description":"","creator":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":9,"state":"open","created_at":"2015-01-30T22:42:13Z","updated_at":"2015-03-09T23:04:22Z","due_on":"2015-03-20T07:00:00Z","closed_at":null},"comments":1,"created_at":"2015-03-05T01:07:33Z","updated_at":"2015-03-10T21:05:14Z","closed_at":null,"body":"I expect DAO errors to be returned in the following form:\r\n\r\n```lua\r\n{\r\n  database = true,\r\n  message = \"localhost could not be resolved (3: Host not found)\"\r\n}\r\n```\r\n\r\nBut sometimes they show up in an inconsistent format, like: \r\n\r\n```lua\r\n{\r\n  database = true,\r\n  message = {\r\n    database = true,\r\n    message = \"localhost could not be resolved (3: Host not found)\"\r\n  }\r\n}\r\n```\r\n\r\nThis specific example can be replicated by setting an invalid IP address/host in the Cassandra `hosts` property, starting the server and making a request."},"comment":{"url":"https://api.github.com/repos/Mashape/kong/issues/comments/78148043","html_url":"https://github.com/Mashape/kong/issues/55#issuecomment-78148043","issue_url":"https://api.github.com/repos/Mashape/kong/issues/55","id":78148043,"user":{"login":"thibaultCha","id":1125431,"avatar_url":"https://avatars.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultCha","html_url":"https://github.com/thibaultCha","followers_url":"https://api.github.com/users/thibaultCha/followers","following_url":"https://api.github.com/users/thibaultCha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultCha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultCha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultCha/subscriptions","organizations_url":"https://api.github.com/users/thibaultCha/orgs","repos_url":"https://api.github.com/users/thibaultCha/repos","events_url":"https://api.github.com/users/thibaultCha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultCha/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T21:05:14Z","updated_at":"2015-03-10T21:05:14Z","body":"I really can't reproduce this. Here is an attempt:\r\n\r\n```lua\r\nlocal inspect = require \"inspect\"\r\n\r\nlocal new_factory = CassandraFactory({ hosts = \"helloworld\",\r\n                                       port = 45678,\r\n                                       timeout = 1000,\r\n                                       keyspace = configuration.cassandra.keyspace\r\n})\r\n\r\nlocal err = new_factory:prepare()\r\nprint(inspect(err))\r\n\r\nlocal api_t = faker:fake_entity(\"api\")\r\nlocal api, err = new_factory.apis:insert(api_t)\r\nprint(inspect(err))\r\n```\r\n\r\nIt's just doing as currently expected, failing on prepare and throwing an error on insert:\r\n\r\n```\r\n{\r\n  database = true,\r\n  message = \"host not found\"\r\n}\r\n```\r\n\r\nBut since `main.lua` exits on a prepare error, I really don't understand how this can happen. Please provide a test to reproduce.\r\n\r\n"}}