_defaultCode; } if (is_array($message)) { $this->_attributes = $message; $message = vsprintf($this->_messageTemplate, $message); } parent::__construct($message, $code, $previous); } /** * Get the passed in attributes * * @return array */ public function getAttributes() { return $this->_attributes; } /** * Get/set the response header to be used * * See also Cake\Http\Response::withHeader() * * @param string|array|null $header An array of header strings or a single header string * - an associative array of "header name" => "header value" * - an array of string headers is also accepted (deprecated) * @param string|null $value The header value. * @return array|null */ public function responseHeader($header = null, $value = null) { if ($header === null) { return $this->_responseHeaders; } if (is_array($header)) { if (isset($header[0])) { deprecationWarning( 'Passing a list string headers to Exception::responseHeader() is deprecated. ' . 'Use an associative array instead.' ); } return $this->_responseHeaders = $header; } $this->_responseHeaders = [$header => $value]; } }