Introduction
Throwing and rethrowing help you handle errors in your program. You can stop the program when something goes wrong or pass the error up to fix it later.
When you want to stop the program because something unexpected happened.
When you catch an error but want to add more information before passing it on.
When you want to log an error and then let another part of the program handle it.
When you want to clean up resources before passing the error up.
When you want to keep the original error details while handling it in multiple places.