try catch
This commit is contained in:
parent
576a2c2fc8
commit
875518abd3
2 changed files with 39 additions and 15 deletions
|
|
@ -23,8 +23,13 @@ $headers = @{
|
|||
'accept' = 'application/vnd.api+json'
|
||||
'Authorization' = "$apiKey"
|
||||
}
|
||||
$claninfo = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/clans/$clanid" -Method GET -Headers $headers
|
||||
|
||||
try {
|
||||
$claninfo = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/clans/$clanid" -Method GET -Headers $headers
|
||||
} catch {
|
||||
write-output "sleeping for 61 sec"
|
||||
start-sleep -Seconds 61
|
||||
$claninfo = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/clans/$clanid" -Method GET -Headers $headers
|
||||
}
|
||||
# Get current date and time
|
||||
$currentDateTime = Get-Date
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue