You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

12 lines
409 B

from rest_framework import status
from rest_framework.exceptions import APIException
class FileParseException(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = 'Invalid file format, line {}: {}'
default_code = 'invalid'
def __init__(self, line_num, line, code=None):
detail = self.default_detail.format(line_num, line)
super().__init__(detail, code)