Hi all,
I hope this is the right place to ask the question. I searched around a little but didn't find an answer.
I'd like to know why the developers decided to break the "open/closed" principle by modifying the behavior of the ValidationError class so that it no longer behaves like the parent class (Exception).
The difference I'm talking about is that the message attribute of a ValidationError instance is a list instead of a string.
To access the message, you need to use:
e.message[0]
instead of the usual:
e.message
This makes it more difficult to integrate django validators in non-django projects. It is obviously possible to code around this but I am curious as why it was done like this and what others have done to get around this.
Kind regards,
Matthys Kroon