Get Familiar with Apex Errors!
Humans are bound to make some mistakes. We all face some errors while we code. It is perfectly fine if errors are encountered.
The main thing which we need to focus here is why do we get such exceptions and how can we resolve them.
- List has no rows for assignment to SObject: When query doesn't return any record. Check your query and put appropriate filters.