/src/net/error.cpp
C++ | 40 lines | 13 code | 3 blank | 24 comment | 0 complexity | 5d7ec064978c6db33180feaa59f1f779 MD5 | raw file
Possible License(s): GPL-2.0
- /* error.cpp - Error output code. Prints socket errors and terminates program.
- *
- * Copyright (C) 2011 Craig Sturdy
- *
- * Email: craig <at> sturd <dot> co <dot> uk
- * Example Usage: http://sturd.co.uk/
- *
- * error.cpp is the legal property of its developer.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
- #include "error.h"
- void SocketError( std::string error_msg, int error = 0 )
- {
- std::cout << "Error: " << error_msg << std::endl;
- std::cout << "Terminating..." << std::endl;
- exit( error );
- }
- void SocketError( std::string error_msg )
- {
- std::cout << "Error: " << error_msg << std::endl;
- std::cout << "Terminating..." << std::endl;
- exit( 0 );
- }