Finished checkpoint 2

This commit is contained in:
zoeyande2
2026-02-20 20:36:31 -05:00
parent c931ea3abe
commit e887b0fae0

View File

@@ -23,10 +23,10 @@ Maybe if you wanted to create a more user-friendly (or more aesthetically pleasi
program's behavior. Describe a few routes which you think may exist for your program's behavior. Describe a few routes which you think may exist for your
chosen program's backend server. chosen program's backend server.
A site I use frequently is Google Docs. I imagine that a route it has would have something to do with saving your work. This is probably on a timer or happens manually when you hit the save button, and then it recieves the input you've written in the file and saves it as a data structure somewhere in your cloud. Similarly, there must be a route that happens when you search within your Google Docs home for the doc you want to work on and it returns the best fit based on the title of the file that you put in the search bar.
4. In your own words, what is an exception? When might it be useful to handle an 4. In your own words, what is an exception? When might it be useful to handle an
exception? When is it better not to handle an exception, and instead let the exception? When is it better not to handle an exception, and instead let the
program crash? program crash?
An exception is when there is an error from the user (input) of the program/request and not an error on behalf of the program (hence why the examples are all 400 errors and not 500 errors.) I think a good time to handle an exception would be when there is a common user error that you can anticipate and you have a specific way you want it to be addressed. For example, a common error would be to not include all the necessary parameters for a request, and instead of crashing the program, the computer could use a default for those parameters. However, sometimes it may be difficult to come up with a good alternative when an error occurs, like in the instance where you put in a riddle ID that doesn't exist. You wouldn't want the program to just return a random riddle or use some default, you would want the program to stop and tell the user that there is an error.