def error_from_serialization_exception(exception, included=False):
 type_ = collection_name(get_model(exception.instance))
 id_ = primary_key_value(exception.instance)
 if (exception.message is not None):
  detail = exception.message
 else:
  resource = ('included resource' if included else 'resource')
  detail = 'Failed to serialize {0} of type {1} and ID {2}'
  detail = detail.format(resource, type_, id_)
 return error(status=500, detail=detail)

def error_from_serialization_exception ( exception , included = False ) : type_ = collection_name ( get_model ( exception . instance ) ) id_ = primary_key_value ( exception . instance ) if ( exception . message is not None ) : detail = exception . message else : resource = ( 'included resource' if included else 'resource' ) detail = 'Failed to serialize {0} of type {1} and ID {2}' detail = detail . format ( resource , type_ , id_ ) return error ( status = 500 , detail = detail )
returns an error dictionary .