exceptionite icon indicating copy to clipboard operation
exceptionite copied to clipboard

Ensure that serialization of data cannot raise an error when handling an exception

Open girardinsamuel opened this issue 2 years ago • 3 comments

It should also be ensured on Masonite blocks or tabs:

https://github.com/MasoniteFramework/masonite/blob/b166e959baa1f0a641259cec03472cfd38c57f0d/src/masonite/providers/ExceptionProvider.py#L46

girardinsamuel avatar Apr 13 '22 14:04 girardinsamuel

All blocks or tab have a serialize() method, inside this we should not get a serialization error.

If we have one we could still add a try/except in the web renderer render() method to catch Serialization error and display something to the user ?

girardinsamuel avatar Apr 13 '22 14:04 girardinsamuel

To reproduce the error we can do a file upload from a POST, and put file into a variable, then raise an exception.

The local variables will contain a file which is not serializable.

girardinsamuel avatar Apr 18 '22 17:04 girardinsamuel

So we could at first try to serialize in a nice way internal masonite classes:

  • UploadeFile
  • Stream
  • ...

girardinsamuel avatar Apr 24 '22 08:04 girardinsamuel