#NEWLINE# def handle_exception( self , exc ) : #NEWLINE# #INDENT# if isinstance ( exc , DjangoPermissionDenied ) : #NEWLINE# #INDENT# response = Response ( { #NEWLINE# #INDENT# 'detail' : { #NEWLINE# #INDENT# 'error' : 'PermissionDenied' , #NEWLINE# 'specific_error' : str ( self ) , #NEWLINE# 'fields' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , status = status . HTTP_403_FORBIDDEN ) #NEWLINE# response . exception = True #NEWLINE# return response #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return super ( XOSListCreateAPIView , self ) . handle_exception ( exc )