00001 00002 /*************************************************************************** 00003 * Copyright (C) 2007 Eddie * 00004 * * 00005 * This file is part of fastcgi++. * 00006 * * 00007 * fastcgi++ is free software: you can redistribute it and/or modify it * 00008 * under the terms of the GNU Lesser General Public License as published * 00009 * by the Free Software Foundation, either version 3 of the License, or (at * 00010 * your option) any later version. * 00011 * * 00012 * fastcgi++ is distributed in the hope that it will be useful, but WITHOUT * 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * 00015 * License for more details. * 00016 * * 00017 * You should have received a copy of the GNU Lesser General Public License * 00018 * along with fastcgi++. If not, see <http://www.gnu.org/licenses/>. * 00019 ****************************************************************************/ 00020 00021 #include <fastcgi++/exceptions.hpp> 00022 00023 #include <sstream> 00024 00025 Fastcgipp::Exceptions::Param::Param(Fastcgipp::Protocol::FullId id_): Request(id_) 00026 { 00027 std::stringstream sstr; 00028 sstr << "Error in parameter code conversion in request #" << id.fcgiId << " of file descriptor #" << id.fd; 00029 msg=sstr.str(); 00030 } 00031 00032 Fastcgipp::Exceptions::Stream::Stream(Fastcgipp::Protocol::FullId id_): Request(id_) 00033 { 00034 std::stringstream sstr; 00035 sstr << "Error in output stream code conversion in request #" << id.fcgiId << " of file descriptor #" << id.fd; 00036 msg=sstr.str(); 00037 } 00038 00039 Fastcgipp::Exceptions::RecordOutOfOrder::RecordOutOfOrder(Fastcgipp::Protocol::FullId id_, Protocol::RecordType expectedRecord_, Protocol::RecordType recievedRecord_) 00040 : Request(id_), expectedRecord(expectedRecord_), recievedRecord(recievedRecord_) 00041 { 00042 std::stringstream sstr; 00043 sstr << "Error: Parameter of type " << Protocol::recordTypeLabels[recievedRecord] << " when type " << Protocol::recordTypeLabels[expectedRecord] << " was expected in request #" << id.fcgiId << " of file descriptor #" << id.fd; 00044 msg=sstr.str(); 00045 } 00046 00047 Fastcgipp::Exceptions::SocketWrite::SocketWrite(int fd_, int erno_): Socket(fd_, erno_) 00048 { 00049 std::stringstream sstr; 00050 sstr << "Error writing to socket #" << fd << " with errno=" << erno; 00051 msg=sstr.str(); 00052 } 00053 00054 Fastcgipp::Exceptions::SocketRead::SocketRead(int fd_, int erno_): Socket(fd_, erno_) 00055 { 00056 std::stringstream sstr; 00057 sstr << "Error reading from socket #" << fd << " with errno=" << erno; 00058 msg=sstr.str(); 00059 } 00060 00061 Fastcgipp::Exceptions::Poll::Poll(int erno_): erno(erno_) 00062 { 00063 std::stringstream sstr; 00064 sstr << "Error in poll with errno=" << erno; 00065 msg=sstr.str(); 00066 }