2013-08-05 21:56:18 |
Luis A. Garcia |
description |
There was a recent change (commit c5ab336) to implement returning consistent errors in JSON or XML with a pre-defined schema so that those error responses can be parsed programmatically, some errors are still coming back in plain text (not JSON or XML),. regardless of the Accept header used.
For example:
Doing a GET /stacks/unknown-stack
Will yield a nice JSON response
{
"explanation":"The resource could not be found.",
"code":404,
"error":{
"message":"The Stack (unknown-stack) could not be found.",
"traceback":"Traceback (most recent call last):\n\n File \"/opt/stack/heat/heat/openstack/common/rpc/amqp.py\", line 424, in _process_data\n **args)\n\n File \"/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py\", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 54, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 147, in identify_stack\n raise exception.StackNotFound(stack_name=stack_name)\n\nStackNotFound: The Stack (unknown-stack) could not be found.\n",
"type":"StackNotFound"
},
"title":"Not Found"
}
But doing a POST /stacks
Body: {}
Will yield the following plain text response:
400 Bad Request
No stack name specified |
There was a recent change (commit c5ab336) to implement returning consistent errors in JSON or XML with a pre-defined schema so that those error responses can be parsed programmatically, however some errors are still coming back in plain text (not JSON or XML), regardless of the Accept header used.
For example:
Doing a GET /stacks/unknown-stack
Will yield a nice JSON response
{
"explanation":"The resource could not be found.",
"code":404,
"error":{
"message":"The Stack (unknown-stack) could not be found.",
"traceback":"Traceback (most recent call last):\n\n File \"/opt/stack/heat/heat/openstack/common/rpc/amqp.py\", line 424, in _process_data\n **args)\n\n File \"/opt/stack/heat/heat/openstack/common/rpc/dispatcher.py\", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 54, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File \"/opt/stack/heat/heat/engine/service.py\", line 147, in identify_stack\n raise exception.StackNotFound(stack_name=stack_name)\n\nStackNotFound: The Stack (unknown-stack) could not be found.\n",
"type":"StackNotFound"
},
"title":"Not Found"
}
But doing a POST /stacks
Body: {}
Will yield the following plain text response:
400 Bad Request
No stack name specified |
|