3👍
✅
After lots of effort and I don’t know why,
If I specify the exception type of inner function, I will get 5XX series error.
so in dummy function I just wrote :
def dummy_function_1():
try:
validate_1(id)
except Exception: # just exception, Not ValidationError or other exception
raise ValidationError()
I could get 4XX series error
1👍
Try this:
def dummy_function_1():
try:
validate_1(id)
except Exception: # just exception, Not ValidationError or other exceptions
raise ValidationError()
- [Django]-How do I include a template that includes another template?
- [Django]-Django multiple pks in url
- [Django]-Python Django ImportError: cannot import name 'Required' from 'typing_extensions'
- [Django]-Set multiple cookies with the same name in Django
- [Django]-Send notification on post_save signal in django
Source:stackexchange.com