@@ -24,8 +24,7 @@ async def test_permission_error_handling():
2424 print ("🧪 TESTING PERMISSION ERROR HANDLING" )
2525 print ("=" * 70 )
2626
27- print (
28- """
27+ print ("""
2928This test demonstrates the improved error handling when your API token
3029lacks zone creation permissions.
3130
@@ -34,8 +33,7 @@ async def test_permission_error_handling():
3433 ✅ Direct link to fix the problem
3534 ✅ No silent failures
3635 ✅ Helpful instructions for users
37- """
38- )
36+ """ )
3937
4038 if not os .environ .get ("BRIGHTDATA_API_TOKEN" ):
4139 print ("\n ❌ ERROR: No API token found" )
@@ -76,17 +74,15 @@ async def test_permission_error_handling():
7674 print ("\n " + "=" * 70 )
7775 print ("📝 This is the IMPROVED error handling!" )
7876 print ("=" * 70 )
79- print (
80- """
77+ print ("""
8178Before: Error was unclear and could fail silently
8279After: Clear message with actionable steps to fix the issue
8380
8481The error message should have told you:
8582 1. ❌ What went wrong (permission denied)
8683 2. 🔗 Where to fix it (https://brightdata.com/cp/setting/users)
8784 3. 📋 What to do (enable zone creation permission)
88- """
89- )
85+ """ )
9086 return True # This is expected behavior
9187
9288 except Exception as e :
@@ -105,15 +101,13 @@ async def test_permission_error_handling():
105101 if success :
106102 print ("✅ TEST PASSED" )
107103 print ("=" * 70 )
108- print (
109- """
104+ print ("""
110105Summary:
111106 • Permission errors are now caught and displayed clearly
112107 • Users get actionable instructions to fix the problem
113108 • No more silent failures
114109 • SDK provides helpful guidance
115- """
116- )
110+ """ )
117111 else :
118112 print ("❌ TEST FAILED" )
119113 print ("=" * 70 )
0 commit comments