Add logging for Pax8
This commit is contained in:
@@ -28,7 +28,8 @@ function Get-Pax8AccessToken {
|
||||
try {
|
||||
$response = Invoke-RestMethod -Method Post -Uri "https://api.pax8.com/v1/token" -ContentType "application/json" -Body $body
|
||||
return $response.access_token
|
||||
} catch {
|
||||
}
|
||||
catch {
|
||||
throw "Failed to obtain Pax8 access token: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
@@ -78,7 +79,9 @@ function Invoke-Pax8Provision {
|
||||
-ContentType "application/json" -Body $companyPayload
|
||||
|
||||
Write-Host "[PAX8] Company provisioned successfully: $($response.id)"
|
||||
} catch {
|
||||
throw "[PAX8] Company creation failed: $($_.Exception.Message)"
|
||||
}
|
||||
catch {
|
||||
Write-Host "[ERROR] Pax8 provisioning failed: $($_.Exception.Message)"
|
||||
[System.Windows.MessageBox]::Show("Pax8 provisioning failed:`n$($_.Exception.Message)", "Pax8 Error")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user