-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ported fmt.Errorf() -> fmt.Println() #15
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we now actually are making use of those lines. It now raises a new problem.
The problem
Consider the case where the user did not use Amrita VPN and an error is thrown. What happens is:
Execute()
-> start()
-> getCoursesReq()
-> fetchHTML()
In fetchHTML()
Line 16 in 0b8264e
fmt.Println("Error fetching the URL. Make sure you're connected to Amrita WiFi or VPN.") |
This line prints the error first.
But we're also carrying the err
string from fetchHTML
back all the way to start()
and printing it.
Now in the output: - TWO ERROR messages but in reverse order.
Error fetching the URL. Make sure you're connected to Amrita WiFi or VPN.
failed to fetch the HTML content
This doesn't look good to me. If we can give a cause and effect relationship to this and print properly, it will be useful.
Else, we can just ignore this error message.
Or have a logger that separates debug
and info
level error messages to make better use of the logs.
What's your take on this @IAmRiteshKoushik and @Abhinav-ark?
@Ashrockzzz2003 if we are porting the application to a TUI then we can have a It can keep track of all events that are happening within the application and give visual updates to the user. (think of it as being similar to the chat section of a multiplayer gaming lobby - PLAYER JOINED, PLAYED LEFT, etc.) |
@Ashrockzzz2003 @IAmRiteshKoushik ErrorF was used because I wanted the application to stop in case of Errors. |
I faced this issue when i tried to change Errorf to print. |
But return is already there to stop. But I'm sure |
let's try |
Change Log
fmt.Errorf
in favour offmt.Println
(better fix needed)go fmt
This PR completes issue #6
Please review and merge @Ashrockzzz2003 @Abhinav-ark