Skip to content

Commit

Permalink
Merge pull request #29 from remotelyliving/bug-fix
Browse files Browse the repository at this point in the history
Loosen up caught exceptions in CloudFlare resolver, remove trailing c…
  • Loading branch information
Christian Thomas authored Oct 15, 2020
2 parents c1e54a8 + 26cee27 commit 7ab428b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Entities/DataAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function createFromTypeAndString(DNSRecordType $recordType, string
(int)$parsed[0] ?? 0,
(int) $parsed[1] ?? 0,
(int) $parsed[2] ?? 0,
new Hostname($parsed[3]),
new Hostname($parsed[3])
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Resolvers/CloudFlare.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function doQuery(Hostname $hostname, DNSRecordType $type): DNSRecordCo
return (!$type->isA(DNSRecordType::TYPE_ANY))
? $this->doApiQuery($hostname, $type)
: $this->doAnyApiQuery($hostname);
} catch (RequestException $e) {
} catch (\Throwable $e) {
throw new QueryFailure("Unable to query CloudFlare API", 0, $e);
}
}
Expand All @@ -69,7 +69,7 @@ private function doAnyApiQuery(Hostname $hostname): DNSRecordCollection
$this->parseResult((array) json_decode((string)$response->getBody(), true))
);
},
'rejected' => function (RequestException $e): void {
'rejected' => function (\Throwable $e): void {
throw $e;
},
]);
Expand Down

0 comments on commit 7ab428b

Please sign in to comment.