Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > dc51c7d3f8a5588a609f484ef81504ee > files > 79

libfastcgipp-devel-1.1-2mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>fastcgi++: exceptions.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
<h1>exceptions.cpp</h1><a href="exceptions_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="comment">/***************************************************************************</span>
<a name="l00003"></a>00003 <span class="comment">* Copyright (C) 2007 Eddie                                                 *</span>
<a name="l00004"></a>00004 <span class="comment">*                                                                          *</span>
<a name="l00005"></a>00005 <span class="comment">* This file is part of fastcgi++.                                          *</span>
<a name="l00006"></a>00006 <span class="comment">*                                                                          *</span>
<a name="l00007"></a>00007 <span class="comment">* fastcgi++ is free software: you can redistribute it and/or modify it     *</span>
<a name="l00008"></a>00008 <span class="comment">* under the terms of the GNU Lesser General Public License as  published   *</span>
<a name="l00009"></a>00009 <span class="comment">* by the Free Software Foundation, either version 3 of the License, or (at *</span>
<a name="l00010"></a>00010 <span class="comment">* your option) any later version.                                          *</span>
<a name="l00011"></a>00011 <span class="comment">*                                                                          *</span>
<a name="l00012"></a>00012 <span class="comment">* fastcgi++ is distributed in the hope that it will be useful, but WITHOUT *</span>
<a name="l00013"></a>00013 <span class="comment">* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    *</span>
<a name="l00014"></a>00014 <span class="comment">* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public     *</span>
<a name="l00015"></a>00015 <span class="comment">* License for more details.                                                *</span>
<a name="l00016"></a>00016 <span class="comment">*                                                                          *</span>
<a name="l00017"></a>00017 <span class="comment">* You should have received a copy of the GNU Lesser General Public License *</span>
<a name="l00018"></a>00018 <span class="comment">* along with fastcgi++.  If not, see &lt;http://www.gnu.org/licenses/&gt;.       *</span>
<a name="l00019"></a>00019 <span class="comment">****************************************************************************/</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;<a class="code" href="exceptions_8hpp.html" title="Defines fastcgi++ exceptions.">fastcgi++/exceptions.hpp</a>&gt;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1Param.html#445757efff18b9c7d772698650c29757">00025</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1Param.html#445757efff18b9c7d772698650c29757" title="Sole Constructor.">Fastcgipp::Exceptions::Param::Param</a>(<a class="code" href="structFastcgipp_1_1Protocol_1_1FullId.html" title="A full ID value for a FastCGI request.">Fastcgipp::Protocol::FullId</a> id_): <a class="code" href="classFastcgipp_1_1Exceptions_1_1Request.html" title="General fastcgi++ request exception.">Request</a>(id_)
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027    std::stringstream sstr;
<a name="l00028"></a>00028    sstr &lt;&lt; <span class="stringliteral">"Error in parameter code conversion in request #"</span> &lt;&lt; <span class="keywordtype">id</span>.fcgiId &lt;&lt; <span class="stringliteral">" of file descriptor #"</span> &lt;&lt; <span class="keywordtype">id</span>.fd;
<a name="l00029"></a>00029    <a class="code" href="classFastcgipp_1_1Exceptions_1_1Param.html#63c810644dcac3a70242f540622d1eb4" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1Stream.html#d996e17a4c43839064aac54d78653fdd">00032</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1Stream.html#d996e17a4c43839064aac54d78653fdd" title="Sole Constructor.">Fastcgipp::Exceptions::Stream::Stream</a>(<a class="code" href="structFastcgipp_1_1Protocol_1_1FullId.html" title="A full ID value for a FastCGI request.">Fastcgipp::Protocol::FullId</a> id_): <a class="code" href="classFastcgipp_1_1Exceptions_1_1Request.html" title="General fastcgi++ request exception.">Request</a>(id_)
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034    std::stringstream sstr;
<a name="l00035"></a>00035    sstr &lt;&lt; <span class="stringliteral">"Error in output stream code conversion in request #"</span> &lt;&lt; <span class="keywordtype">id</span>.fcgiId &lt;&lt; <span class="stringliteral">" of file descriptor #"</span> &lt;&lt; <span class="keywordtype">id</span>.fd;
<a name="l00036"></a>00036    <a class="code" href="classFastcgipp_1_1Exceptions_1_1Stream.html#beded9b300d400b0b94da76231f08d37" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00037"></a>00037 }
<a name="l00038"></a>00038 
<a name="l00039"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1RecordOutOfOrder.html#60e1b39d10ef8213f22ba95bbaeedd5e">00039</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1RecordOutOfOrder.html#60e1b39d10ef8213f22ba95bbaeedd5e" title="Sole Constructor.">Fastcgipp::Exceptions::RecordOutOfOrder::RecordOutOfOrder</a>(<a class="code" href="structFastcgipp_1_1Protocol_1_1FullId.html" title="A full ID value for a FastCGI request.">Fastcgipp::Protocol::FullId</a> id_, <a class="code" href="namespaceFastcgipp_1_1Protocol.html#79e41b489a9b2c0374eee108d375b646" title="Defines the types of records within the FastCGI protocol.">Protocol::RecordType</a> expectedRecord_, <a class="code" href="namespaceFastcgipp_1_1Protocol.html#79e41b489a9b2c0374eee108d375b646" title="Defines the types of records within the FastCGI protocol.">Protocol::RecordType</a> recievedRecord_)
<a name="l00040"></a>00040 : <a class="code" href="classFastcgipp_1_1Exceptions_1_1Request.html" title="General fastcgi++ request exception.">Request</a>(id_), expectedRecord(expectedRecord_), recievedRecord(recievedRecord_)
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042    std::stringstream sstr;
<a name="l00043"></a>00043    sstr &lt;&lt; <span class="stringliteral">"Error: Parameter of type "</span> &lt;&lt; <a class="code" href="namespaceFastcgipp_1_1Protocol.html#8607c10121810606b4ed541673027c0d" title="Defines text labels for the RecordType values.">Protocol::recordTypeLabels</a>[<a class="code" href="classFastcgipp_1_1Exceptions_1_1RecordOutOfOrder.html#56f6f148a2e5ae0e988299da93398e58" title="Type of record that was recieved.">recievedRecord</a>] &lt;&lt; <span class="stringliteral">" when type "</span> &lt;&lt; <a class="code" href="namespaceFastcgipp_1_1Protocol.html#8607c10121810606b4ed541673027c0d" title="Defines text labels for the RecordType values.">Protocol::recordTypeLabels</a>[<a class="code" href="classFastcgipp_1_1Exceptions_1_1RecordOutOfOrder.html#08a27839fa3163c8be536e6229ac8fec" title="Type of record that was expected.">expectedRecord</a>] &lt;&lt; <span class="stringliteral">" was expected in request #"</span> &lt;&lt; <span class="keywordtype">id</span>.fcgiId &lt;&lt; <span class="stringliteral">" of file descriptor #"</span> &lt;&lt; <span class="keywordtype">id</span>.fd;
<a name="l00044"></a>00044    <a class="code" href="classFastcgipp_1_1Exceptions_1_1RecordOutOfOrder.html#1db8729972d144bd055f95075e378c73" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046 
<a name="l00047"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketWrite.html#504556689fd04525e88db4be17863bda">00047</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketWrite.html#504556689fd04525e88db4be17863bda" title="Sole Constructor.">Fastcgipp::Exceptions::SocketWrite::SocketWrite</a>(<span class="keywordtype">int</span> fd_, <span class="keywordtype">int</span> erno_): <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html" title="General exception for socket related errors.">Socket</a>(fd_, erno_)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049    std::stringstream sstr;
<a name="l00050"></a>00050    sstr &lt;&lt; <span class="stringliteral">"Error writing to socket #"</span> &lt;&lt; <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html#f18bcfa989c76a354f9b1622af4f9c73" title="File descriptor of socket.">fd</a> &lt;&lt; <span class="stringliteral">" with errno="</span> &lt;&lt; <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html#5b06369c2f33ce35bbaf757348970e59" title="Associated errno.">erno</a>;
<a name="l00051"></a>00051    <a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketWrite.html#f72ded2aa784c379031a98807f88b134" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketRead.html#7d1bdda3376e37c47cd98735171ab513">00054</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketRead.html#7d1bdda3376e37c47cd98735171ab513" title="Sole Constructor.">Fastcgipp::Exceptions::SocketRead::SocketRead</a>(<span class="keywordtype">int</span> fd_, <span class="keywordtype">int</span> erno_): <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html" title="General exception for socket related errors.">Socket</a>(fd_, erno_)
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056    std::stringstream sstr;
<a name="l00057"></a>00057    sstr &lt;&lt; <span class="stringliteral">"Error reading from socket #"</span> &lt;&lt; <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html#f18bcfa989c76a354f9b1622af4f9c73" title="File descriptor of socket.">fd</a> &lt;&lt; <span class="stringliteral">" with errno="</span> &lt;&lt; <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html#5b06369c2f33ce35bbaf757348970e59" title="Associated errno.">erno</a>;
<a name="l00058"></a>00058    <a class="code" href="classFastcgipp_1_1Exceptions_1_1SocketRead.html#da05963acc42897f6bc1fd03d55603f5" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="classFastcgipp_1_1Exceptions_1_1Poll.html#cbac69e320c00b584acabeaef201c90b">00061</a> <a class="code" href="classFastcgipp_1_1Exceptions_1_1Poll.html#cbac69e320c00b584acabeaef201c90b" title="Sole Constructor.">Fastcgipp::Exceptions::Poll::Poll</a>(<span class="keywordtype">int</span> erno_): <a class="code" href="classFastcgipp_1_1Exceptions_1_1Socket.html#5b06369c2f33ce35bbaf757348970e59" title="Associated errno.">erno</a>(erno_)
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063    std::stringstream sstr;
<a name="l00064"></a>00064    sstr &lt;&lt; <span class="stringliteral">"Error in poll with errno="</span> &lt;&lt; <a class="code" href="classFastcgipp_1_1Exceptions_1_1Poll.html#db58bfef99cb7072fbe4619ae9d700a7" title="Associated errno.">erno</a>;
<a name="l00065"></a>00065    <a class="code" href="classFastcgipp_1_1Exceptions_1_1Poll.html#321d625a3bf788ccac213c6173cca613" title="Error message associated with the exception.">msg</a>=sstr.str();
<a name="l00066"></a>00066 }
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 16 15:17:46 2008 for fastcgi++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>