Revision 1993fea9 pithos/api/util.py

b/pithos/api/util.py
39 39

  
40 40
from django.conf import settings
41 41
from django.http import HttpResponse
42
from django.utils import simplejson as json
42 43
from django.utils.http import http_date, parse_etags
43 44

  
44 45
from pithos.api.compat import parse_http_date_safe, parse_http_date
......
258 259
        raise ItemNotFound('Container or object does not exist')
259 260
    except ValueError:
260 261
        raise BadRequest('Invalid sharing header')
261
    except AttributeError:
262
        raise Conflict('Sharing already set above or below this path in the hierarchy')
262
    except AttributeError, e:
263
        raise Conflict(json.dumps(e.data))
263 264
    if public is not None:
264 265
        try:
265 266
            backend.update_object_public(request.user, v_account, v_container, v_object, public)
......
666 667
def render_fault(request, fault):
667 668
    if settings.DEBUG or settings.TEST:
668 669
        fault.details = format_exc(fault)
669

  
670
    
670 671
    request.serialization = 'text'
671 672
    data = '\n'.join((fault.message, fault.details)) + '\n'
672 673
    response = HttpResponse(data, status=fault.code)

Also available in: Unified diff