client: Create proper exception handling