street-lab-tech / street-whisper-app

STREET Lab Whisper App - a tool that transcribes and translates audio files into CSV files.
MIT License
2 stars 0 forks source link

Bug: CLI doesn't give correct error message for invalid audio path inputs #14

Closed carmen-chau closed 4 months ago

carmen-chau commented 4 months ago

General summary: Need to properly handle error messages when user gives invalid audio path inputs and/or invalid destination paths.

Case 1: When user types in invalid audio path Note: Still need to double check whether the path is invalid as in: Invalid path on computer, or invalid because the file extension it refers to is invalid

When a user types in an invalid audio path, followed by a valid destination path, the CLI just says "token does not exist" when re-prompting the user to try again. This is not the correct reason.

moonsdust commented 4 months ago

The script is pretty much running in a try except block. So that means that for any errors in receives from the script, it will return “Token Doesn’t Exist”. So because of this, you can check the error and have it print to the correct error statement instead of only “Token Doesn’t Exist”.

carmen-chau commented 4 months ago

@moonsdust Additional comment: Do you think it would be wise to truncate leading and trailing whitespace from an audio input path and the destination path, in case the user types an extra beginning or ending space by accident? IMO I think we should handle this case but wanna hear your thoughts

Having even 1 extra space by accident renders an invalid path so this fix might reduce the number of times a user needs to be reprompted

moonsdust commented 4 months ago

@carmen-chau I think we should do that with removing trailing and leading whitespace. I can implement that when working on the issue for spaces in the name

carmen-chau commented 4 months ago

Sure that sounds great, let me know if you need support with it!

@carmen-chau I think we should do that with removing trailing and leading whitespace. I can implement that when working on the issue for spaces in the name