copilot-metrics-viewer icon indicating copy to clipboard operation
copilot-metrics-viewer copied to clipboard

Add error handling for missing GitHub token and explicitly stating VUE_APP_MOCKED_DATA=true in the UI

Open abirismyname opened this issue 1 year ago • 0 comments

This pull request primarily focuses on improving the handling of environment variables in the GitHubApi.ts and MainComponent.vue files. The changes include adding a console log to notify when mock data is being used, throwing an error when the VUE_APP_GITHUB_TOKEN environment variable is not set, and displaying a message on the main component when mock data is being used.

User Feedback Enhancements:

  • src/api/GitHubApi.ts: Added a console log to inform the developer when the application is using mock data.
  • src/components/MainComponent.vue: Added a dynamic error message to the main component's UI to inform the user when the application is using mock data. [1] [2]

Error Handling Improvements:

  • src/api/GitHubApi.ts: Added error handling to throw an error when the VUE_APP_GITHUB_TOKEN environment variable is not set. This prevents the application from making API calls without the necessary authentication token.

abirismyname avatar May 09 '24 19:05 abirismyname