nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Clarification on whether throwing a new error message, for a new scenario discovered where the command fails is considered fixing a bug. #678

Closed zlch closed 2 days ago

zlch commented 2 days ago

A tester discovered a situation where one of the newly implemented commands fails, at the moment the error message thrown is a generic message that provides no information on the reason for failure, would identifying when the conditions for this command failing and throwing a new error message be considered fixing a bug?

damithc commented 2 days ago

@zlch See if Q6 answers your question.

zlch commented 2 days ago

The closest answers in Q6 is likely

'If a user action fails silently, it can be fixed to inform the user of the problem.'

'Making user-facing info more specific/informative (e.g., changing a generic error message Command format is invalid into a more specific error message The parameter p/ in the command is not valid) is an enhancement i.e., not allowed.' or

' Widening the scope of a message (or making it more general) is allowed. For example, suppose an error can be caused by a problem in parameters x, y, or z but the error message says problem in x or y. In this case the current error message is incomplete and hence you may widen its scope (e.g., problem in x or y or z) or make it more general (e.g., problem in parameters).'

However, in this case there is an error message thrown but does not provide information to the user, the message is 'data\addressbook.json' which I think is the error message thrown by the IO exception which i then catch and throw the same message as a command exception. So I am uncertain which category it falls into. Since it's not completely silent since an error is thrown but is uninformative, but at the moment the actual error is not in the scope of the message as does not give any information, but changing it would be making the message more informative as there is currently no other general error message for that command.

damithc commented 2 days ago

@zlch let's be more specific: What causes the error to occur? What's the current error message? What do you want it to be?

zlch commented 2 days ago

The command is a backup command, the error occurs when there is no data file to backup, currently the only instance of this is when the program starts for the first time, or the user deletes the data file. The current error message is 'data\addressbook,json'. The message that I would like to implement would be at "Backup failed, no data file found to backup." and if possible with additional information "If this is your first time starting the program or you have deleted the data file try another command first."

damithc commented 2 days ago

If data\addressbook,json is the only text shown to the user when this error happens, it is not a generic message, but an incomprehensible message (i.e., it doesn't make sense). An example generic message is Something went wrong with the command!.

If that is indeed the only text shown to the user, you can fix it.

zlch commented 2 days ago

In this case would I be able to replace it with any message that explains the problem or would I have to use a generic message?

damithc commented 2 days ago

@zlch If the amount of code modification (which is what we are trying to minimise during the feature freeze) required by each is the same or very close, you can choose either. Otherwise, choose the one that requires less code changes.

zlch commented 2 days ago

I see thank you Prof!