后端提示错误(文本):
2021-01-18 10:48:00 [ERROR] - Internal Server Error: /api/fastrunner/test/
Traceback (most recent call last):
File "D:\06 code\AnotherFasterRunner\fastrunner\utils\prepare.py", line 191, in generate_casestep
format_http = Format(test['newBody'])
KeyError: 'newBody'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\rest_framework\viewsets.py", line 114, in view
return self.dispatch(request, *args, **kwargs)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\rest_framework\views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\rest_framework\views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\rest_framework\views.py", line 476, in raise_uncaught_exception
raise exc
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\rest_framework\views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\utils\decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "D:\06 code\AnotherFasterRunner\fastrunner\utils\decorator.py", line 24, in inner_wrapper
return func(request, *args, **kwargs)
File "D:\06 code\AnotherFasterRunner\fastrunner\views\suite.py", line 230, in post
prepare.generate_casestep(body, case, request.user.username)
File "D:\06 code\AnotherFasterRunner\fastrunner\utils\prepare.py", line 202, in generate_casestep
config = models.Config.objects.get(name=name)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\db\models\manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Users\aqumon\Envs\my_env\lib\site-packages\django\db\models\query.py", line 408, in get
self.model._meta.object_name
fastrunner.models.Config.DoesNotExist: Config matching query does not exist.
2021-01-18 10:48:03 [ERROR] - "POST /api/fastrunner/test/ HTTP/1.1" 500 27
前端报错:服务器内部错误
![image](https://user-images.githubusercontent.com/59219621/104867209-52cdca80-597b-11eb-94d0-cb84f51485b5.png)
后端报错截图:
![image](https://user-images.githubusercontent.com/59219621/104867069-f9fe3200-597a-11eb-9dd6-c844ad4e9f25.png)