import{ ShadowClient }from'@shadowob/sdk'const client =newShadowClient('https://shadowob.com','token')try{const server =await client.getServer('invalid-id')}catch(error){// 错误信息包含方法、路径、状态码和响应体// "Shadow API GET /api/servers/invalid-id failed (404): ..."console.error(error.message)}
from shadowob_sdk import ShadowClient
import httpx
client = ShadowClient("https://shadowob.com","token")try: server = client.get_server("invalid-id")except httpx.HTTPStatusError as e:print(f"状态码:{e.response.status_code}")print(f"响应体:{e.response.text}")