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

[feature request]: Integrate Custom Error Pages #38

Closed
3 tasks done
ashutoshkrris opened this issue Oct 27, 2021 · 11 comments · Fixed by #43
Closed
3 tasks done

[feature request]: Integrate Custom Error Pages #38

ashutoshkrris opened this issue Oct 27, 2021 · 11 comments · Fixed by #43
Assignees

Comments

@ashutoshkrris
Copy link
Owner

Is there an existing issue for this?

  • I have searched the existing issues.

Describe the feature.

Our application should be able to serve custom error pages whenever it encounters an error.

Problem/Motivation.

Currently, whenever a user encounters an error, the default error pages are shown to the user, which is boring.

Possible Solution/Pitch.

Create view functions in the routes.py file to handle errors and serve custom error page templates.
You can take reference from here

Anything else?

This is a backend-related issue, and any beginner who has little knowledge of Flask can also resolve it.

Note: This issue requires custom error pages templates. There is another issue #37. Once that is resolved, this issue needs to be worked on.

Hacktoberfest

  • Yeah

Code of Conduct

  • I agree to follow this project's Code of Conduct
@github-actions github-actions bot added backend bug Something isn't working enhancement New feature or request good first issue Good for newcomers hacktoberfest Up-For-Grab labels Oct 27, 2021
@ashutoshkrris ashutoshkrris removed the bug Something isn't working label Oct 27, 2021
@taanguyen
Copy link

Hi @ashutoshkrris! I have some knowledge of Flask. May I be assigned this issue? I'll do my best!

@ashutoshkrris
Copy link
Owner Author

Yeah, you can work.
But the problem is, the issue depends on issue #37

For the time being, what you can do is return any custom error page. Later when the issue #37 is resolved, we can change it.
Assigning it to you, @taanguyen

@taanguyen
Copy link

Thank you @ashutoshkrris! If I get stuck, is dropping a comment here the best way to reach you? Do you have a discord for this repo by chance?

@ashutoshkrris
Copy link
Owner Author

You can drop your queries here, or if you wish you can create a discussion

@taanguyen
Copy link

taanguyen commented Oct 28, 2021

I believe I'm done! Thank you for the helpful reference link, Ashutosh! Commit is here. I'll wait for @rachelcynthia to make a pull request.

@rachelcynthia
Copy link
Contributor

@taanguyen I have made a pull request. I linked the pages to custom error routes for the time being. That will have to be deleted later and replaced with routes you designed.

@ashutoshkrris
Copy link
Owner Author

@taanguyen I have merged the PR made by @rachelcynthia
So, you are good to go now.

@taanguyen
Copy link

thank you both!

@taanguyen
Copy link

taanguyen commented Oct 28, 2021

@ashutoshkrris, I tried to recreate the 405 error, but when I send a POST to localhost:5000/ (instead of a GET), I get a 302 and then a GET / request is made which returns a 200. Is that the expected behavior?
Screen Shot 2021-10-27 at 11 33 19 PM

@ashutoshkrris
Copy link
Owner Author

Remove the trailing slash at the end of the URL and try.
A POST request is valid on the index page, because it has a contact form.
You can try a POST request on the Terms of Service Page.

@taanguyen
Copy link

I see the change as index now accepts GET and POST- thank you!

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

Successfully merging a pull request may close this issue.

3 participants