def get(self, platform, username): user_data = UserData(username) try: return user_data.get_details(platform) except UsernameError: return {'status': 'Failed', 'details': 'Invalid username'} except PlatformError: return {'status': 'Failed', 'details': 'Invalid Platform'} except Exception as e: # Reporting bug to me via Email for faster bug detection # Comment this part mail = Mail() mail.send_bug_detected()