Kotlin Spring Boot Tutorial - Part 6 | Runtime Exception - task not found and for a bad request

Опубликовано: 01 Июль 2026
на канале: Habibi Coding
1,031
16

#runtime #exception #found ''Runtime'' ''Exception'' ''found''

Kotlin Spring Boot Tutorial - Part 6 | Runtime Exception - task not found and for a bad request


In this video of our Kotlin Spring Boot tutorial series, we continue building our backend by diving deeper into the TaskRepository interface and implementing custom query methods using both native SQL and JPQL. You’ll learn how methods like findTaskById, queryAllOpenTasks, queryAllClosedTasks, and doesDescriptionExist are constructed to efficiently fetch and validate task data from the database.

We also cover how to create and handle custom exceptions in Kotlin using Spring’s @ResponseStatus annotation. Specifically, we create two custom exception classes: TaskNotFoundException for returning a 404 HTTP status when a task ID doesn't exist in the database, and BadRequestException for 400 errors when a client submits invalid or incomplete data in a POST request (such as missing task description or priority).

These exception classes extend from RuntimeException, making them simple yet powerful tools for managing error states in your Spring Boot application. With this foundation, we’re now fully prepared to implement our service layer in the next video, where the core business logic will reside.

If you're learning Kotlin with Spring Boot, building a REST API, or working with JPA repositories, custom queries, and exception handling, this video will help you write cleaner and more maintainable backend code. Don’t forget to like, comment, and subscribe to stay updated with future videos in the series!

▬▬▬▬▬▬ C H E C K O U T 📚 ▬▬▬▬▬▬
Part 1 on medium.com ► https://shorturl.at/BVBrO
GitHub repo ► https://github.com/habibicoding/cicd-...
Playlist ► https://tinyurl.com/394y63kb

#githubactions #cicd #linode

▬▬▬▬▬▬ Arabic to English vocab ▬▬▬▬▬▬
hello guys and gals / marhaba ya shabaab / مرحبا يا شباب
bye / ila liqa / إِلَى اللِّقَاء

#ubuntu #github #akamai

---------------------------------------------------------------------------------------------------------------------------
Follow me on my socials:
---------------------------------------------------------------------------------------------------------------------------
▬▬▬▬▬▬ L I N K S to social media accounts 🔗 ▬▬▬▬▬▬
medium.com ►   / habibicoding  
INSTAGRAM ►   / habibicoding  
TWITTER ►   / habibi_coding  
FACEBOOK ► https://www.facebook.com/profile.php?...
TIKTOK ►   / habibicoding  
GITHUB ► https://github.com/habibicoding

---------------------------------------------------------------------------------------------------------------------------
Like share subscribe for more amazing updates on this channel 😍
---------------------------------------------------------------------------------------------------------------------------

#runtime #exception #found ''Runtime'' ''Exception'' ''found''

Thanks for watching 💓!!