Commit 9a91402a authored by Steven Murray's avatar Steven Murray
Browse files

Added BadAlloc exception and finished AcceptConnectionInterrupted

parent bbc3c013
......@@ -323,6 +323,7 @@ if (${COMPILE_SERVER} STREQUAL "1")
install(FILES
exception/AcceptConnectionInterrupted.hpp
exception/Backtrace.hpp
exception/BadAlloc.hpp
exception/CommandLineNotParsed.hpp
exception/Communication.hpp
exception/Exception.hpp
......
/******************************************************************************
* BadAlloc.cpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/exception/BadAlloc.hpp"
#include "h/serrno.h"
// -----------------------------------------------------------------------------
// Constructor
// -----------------------------------------------------------------------------
castor::exception::BadAlloc::BadAlloc():
castor::exception::Exception(SEBADALLOC) {
}
/******************************************************************************
* BadAlloc.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#ifndef CASTOR_EXCEPTION_BADALLOC_HPP
#define CASTOR_EXCEPTION_BADALLOC_HPP 1
#include "castor/exception/Exception.hpp"
namespace castor { namespace exception {
/**
* BadAlloc.
*/
class BadAlloc : public castor::exception::Exception {
public:
/**
* Constructor
*/
BadAlloc();
}; // class BadAlloc
} } // namespace castor exception
#endif // CASTOR_EXCEPTION_BADALLOC_HPP
......@@ -35,6 +35,7 @@ set (COMMON_LIB_SRC_FILES
Csecloader.c castor1compat.c
../castor/exception/AcceptConnectionInterrupted.cpp
../castor/exception/AlreadyInitialized.cpp
../castor/exception/BadAlloc.cpp
../castor/exception/Backtrace.cpp
../castor/exception/BadVersion.cpp
../castor/exception/Busy.cpp
......
......@@ -71,6 +71,8 @@ char *sys_serrlist[SEMAXERR-SEBASEOFF+2]=
"Invalid number of arguments",
"Already initialized",
"Command line not parsed",
"Accept connection was interrupted",
"Failed to allocate memory",
"BAD ERROR NUMBER"
};
......
......@@ -24,6 +24,7 @@
%attr(0644,root,root) usr/include/castor/castor/exception/AcceptConnectionInterrupted.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/AlreadyInitialized.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Backtrace.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/BadAlloc.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/CommandLineNotParsed.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Communication.hpp
%attr(0644,root,root) usr/include/castor/castor/exception/Exception.hpp
......
......@@ -82,9 +82,10 @@
#define SEINVALIDNBARGS SEBASEOFF+48 /* Invalid number of arguments */
#define SEALREADYINIT SEBASEOFF+49 /* Already initialized */
#define SECMDLNNOTPRSD SEBASEOFF+50 /* Command line not parsed */
#define SEACCPTCONNINTR SEBASEOFF+51 /* castor::io::acceptConnection() was interrupted */
#define SEACCPTCONNINTR SEBASEOFF+51 /* Accept connection was interrupted */
#define SEBADALLOC SEBASEOFF+52 /* Failed to allocate memory */
#define SEMAXERR SEBASEOFF+51 /* Maximum error number */
#define SEMAXERR SEBASEOFF+52 /* Maximum error number */
#define SERRNO (serrno - SEBASEOFF) /* User convenience */
/*
......
......@@ -205,6 +205,12 @@ The following error values might be returned by any package:
.TP
.B SECMDLNNOTPRSD
(1050) Command line not parsed
.TP
.B SEACCPTCONNINTR
(1051) Accept connection was interrupted
.TP
.B SEBADALLOC
(1052) Failed to allocate memory
.SH COPYTAPE ERRORS
None yet
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment