Skip to content

Fix: Change console.log to console.error for proper error logging #15

Open
Mohit-001-hash wants to merge 1 commit into
Sant60:mainfrom
Mohit-001-hash:fix/console-log-to-console-error
Open

Fix: Change console.log to console.error for proper error logging #15
Mohit-001-hash wants to merge 1 commit into
Sant60:mainfrom
Mohit-001-hash:fix/console-log-to-console-error

Conversation

@Mohit-001-hash
Copy link
Copy Markdown

Description

Fixed improper error logging in the camera initialization
catch block in templates/index.html.

The startCamera() function was using console.log(error) to
log camera access errors. Errors should always be logged
using console.error() as it:

  • Shows errors in red in the browser console
  • Makes debugging much easier
  • Follows JavaScript best practices for error handling

Type of Change

  • Bug fix

Changes Made

File Change
templates/index.html Changed console.log to console.error in startCamera() catch block

How to Test

  1. Open the app in browser
  2. Deny camera access when prompted
  3. Open browser dev tools → Console tab
  4. Verify the error now appears in red as a proper error log

Checklist

  • I have performed a self-review of my code
  • My changes do not break any existing functionality
  • I have commented my code
  • I have tested changes locally

Additional Notes

This is a minor but important fix for proper error handling
and debugging practices.

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

Successfully merging this pull request may close these issues.

1 participant