Treat errors
This commit is contained in:
parent
b1e8e8933d
commit
baf7fd39e1
|
@ -15,7 +15,16 @@ export class PaFirewall {
|
|||
|
||||
const data = await response.text()
|
||||
|
||||
const result = data.includes('status="success"')
|
||||
|
||||
if (!result) {
|
||||
console.log(data)
|
||||
throw new Error('Failed to map user ID to IP')
|
||||
}
|
||||
|
||||
console.log(`Mapped user ${username} to IP ${ip}`)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private createCommand(username: string, ip: string, domain: string) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user