First draft to handle and throw tls exceptions