[ckan-changes] commit/ckan: kindly: add error codes to action api

Bitbucket commits-noreply at bitbucket.org
Tue Jul 19 11:58:10 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/fe8a10739ec2/
changeset:   fe8a10739ec2
branch:      feature-1211-drupal
user:        kindly
date:        2011-07-19 13:57:39
summary:     add error codes to action api
affected #:  1 file (142 bytes)

--- a/ckan/controllers/api.py	Fri Jul 15 15:10:46 2011 +0100
+++ b/ckan/controllers/api.py	Tue Jul 19 12:57:39 2011 +0100
@@ -178,12 +178,14 @@
             return_dict['error'] = {'__type': 'Authorization Error',
                                     'message': _('Access denied')}
             return_dict['success'] = False
+            return self._finish(403, return_dict, content_type='json')
         except ValidationError, e:
             error_dict = e.error_dict 
             error_dict['__type'] = 'Validtion Error'
             return_dict['error'] = error_dict
             return_dict['success'] = False
             log.error('Validation error: %r' % str(e.error_dict))
+            return self._finish(409, return_dict, content_type='json')
         return self._finish_ok(return_dict)
 
     def list(self, ver=None, register=None, subregister=None, id=None):

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list