AndroidBites: That’s how we try-catch ?: Value

Chetan Gupta
1 min readJul 27, 2020

An elegant way of error handling using expressions and null-handing

tryOrNull | Androidbites | Kotlin

Taking inspiration from getOrNull type function in Kotlin, I ended up creating this extension which has helped me out in multiple cases, Specially dealings with JsonParsing .

Highly recommend the following extended explanation of how this extension work, Do checkout and stay tuned for more content.

Happy Hacking!

follow me on social media :
LinkedIn : https://bit.ly/ch8n-linkdIn
Medium: https://bit.ly/ch8n-medium
Twitter: https://bit.ly/ch8n-twitter
Blog: https://chetangupta.net
Github: https://bit.ly/ch8n-git
Youtube: https://bit.ly/ch8n-youtube

--

--

Chetan Gupta

Android & Kotlin Expert | https://chetangupta.net | Training & Technical writing for Bussiness contact https://t.me/ch810