Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
girardinsamuel opened this issue Apr 13, 2022 · 3 comments

Comments

@girardinsamuel
Copy link
Contributor

It should also be ensured on Masonite blocks or tabs:

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

@girardinsamuel
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

  • UploadeFile
  • Stream
  • ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant