Changeset View
Changeset View
Standalone View
Standalone View
src/future/aws/PhutilAWSException.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | final class PhutilAWSException extends Exception { | ||||
public function getRequestID() { | public function getRequestID() { | ||||
return $this->requestID; | return $this->requestID; | ||||
} | } | ||||
public function getHTTPStatus() { | public function getHTTPStatus() { | ||||
return $this->httpStatus; | return $this->httpStatus; | ||||
} | } | ||||
public function isNotFoundError() { | |||||
if ($this->hasErrorCode('InvalidVolume.NotFound')) { | |||||
return true; | |||||
} | |||||
return false; | |||||
} | |||||
private function hasErrorCode($code) { | |||||
$errors = idx($this->params, 'Errors', array()); | |||||
foreach ($errors as $error) { | |||||
if ($error[0] === $code) { | |||||
return true; | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0