Skip to content

fix: create missing 500.html error template (#75)#169

Merged
komalharshita merged 2 commits into
komalharshita:mainfrom
VyakhyaPathak:fix/missing-500-error-template
May 18, 2026
Merged

fix: create missing 500.html error template (#75)#169
komalharshita merged 2 commits into
komalharshita:mainfrom
VyakhyaPathak:fix/missing-500-error-template

Conversation

@VyakhyaPathak
Copy link
Copy Markdown
Contributor

@VyakhyaPathak VyakhyaPathak commented May 16, 2026

Summary [required]

This PR resolves a critical flaw in the server error handling flow by creating the missing 500.html template. Previously, when an uncaught system exception occurred, Flask's 500 handler crashed while looking for this template, raising a secondary TemplateNotFound exception and obscuring the root cause of production failures. Adding this file safely captures unhandled errors and cleanly redirects users back to safety.

Related Issue [required]

Closes #75

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
templates/500.html Created the missing error file using the exact HTML structure, semantic layout elements, and custom typography of 404.html as requested by the admin.

How to Test This PR [required]

  1. Clone this branch: git checkout fix/missing-500-error-template
  2. Install dependencies: py -m pip install -r requirements.txt
  3. Run the tests to confirm system integrity: py tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results [required]

PASS test_projects_json_loads
PASS test_each_project_has_required_fields
PASS test_find_project_by_id_found
PASS test_find_project_by_id_missing
PASS test_parse_skills_basic
PASS test_parse_skills_empty_string
PASS test_parse_skills_single_entry
PASS test_score_single_project_full_match
PASS test_score_single_project_no_match
PASS test_get_recommendations_returns_results
PASS test_get_recommendations_max_three
PASS test_get_recommendations_no_match_returns_empty
PASS test_get_recommendations_result_format
PASS test_validate_all_valid
PASS test_validate_missing_skills
PASS test_validate_missing_level
PASS test_validate_missing_interest
PASS test_validate_missing_time
PASS test_validate_all_missing
PASS test_home_route
PASS test_recommend_api_valid
PASS test_recommend_api_missing_field
PASS test_recommend_api_empty_body
PASS test_project_detail_found
PASS test_project_detail_not_found
PASS test_view_code_found
PASS test_download_code_found

27 passed, 0 failed out of 27 tests

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

The file utilizes proper 2-space indentation and section comment headers to strictly respect the HTML section design rules mentioned in CONTRIBUTING.md.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

@VyakhyaPathak is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

komalharshita
komalharshita previously approved these changes May 17, 2026
Copy link
Copy Markdown
Owner

@komalharshita komalharshita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved for merge

@komalharshita
Copy link
Copy Markdown
Owner

@VyakhyaPathak but first resolve the merge conflicts

@VyakhyaPathak
Copy link
Copy Markdown
Contributor Author

Hi @komalharshita,

Thank you for the review,
I have successfully resolved the merge conflicts. Kindly review.

Copy link
Copy Markdown
Owner

@komalharshita komalharshita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good contribution overall. The missing 500 error template has been implemented cleanly and the PR stays properly scoped to the issue. The page structure is consistent with the existing UI and reuses shared styling appropriately.

Minor non-blocking suggestion: move the inline button styles into the shared stylesheet for better maintainability in future iterations.

Approved for merge.

@komalharshita komalharshita merged commit cde40ff into komalharshita:main May 18, 2026
7 of 8 checks passed
@VyakhyaPathak
Copy link
Copy Markdown
Contributor Author

Thank you for the approval and for merging the PR, @komalharshita! It was great working on this fix. I'll make sure to follow your suggestion about the shared stylesheet in the future.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title: Create missing 500.html error template to fix crashing server error handler

2 participants