The easiest way:
Simulate those things happening, so force the exception of the internet disconnection and see what the error in UiPath. It’ll come with a popup that tells you what the exception category is “Exception: Invalid Reference” for example.
You’ll be able to capture that exact exception within a try catch.
For the invalid credentials, it’ll probably just stall and eventually crash, you can do the same simulation thing above and catch it within the try catch or do an image exists to see if the credentials were incorrect then put a decision in your workflow to determine what to do next.