Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CommonErrors.C

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // Created on Wed Mar 12 20:58:35 PST 1997 by heydon
00020 
00021 // Last modified on Mon Aug  9 18:35:17 EDT 2004 by ken@xorian.net
00022 //      modified on Wed Jun 10 00:31:16 PDT 1998 by heydon
00023 
00024 #include <errno.h>
00025 #include <Basics.H>
00026 #include <VestaSource.H>
00027 #include "CommonErrors.H"
00028 
00029 using std::ostream;
00030 using std::endl;
00031 
00032 ostream& operator<< (ostream &os, const InputError &err) throw ()
00033 /* Print a representation of "err" to "os". */
00034 {
00035     os << "  " << err.msg;
00036     if (!err.arg.Empty()) {
00037         os << ":" << endl;
00038         os << "  '" << err.arg << "'";
00039     }
00040     os << endl;
00041     return os;
00042 }
00043 
00044 ostream& operator<<(ostream &os, const SysError &err) throw ()
00045 /* Print a representation of "err" to "os". */
00046 {
00047     os << "System error in " << err.routine
00048        << " (errno = " << err.myerrno << ")" << endl;
00049     os << "  " << Basics::errno_Text(err.myerrno) << endl;
00050     return os;
00051 }
00052 
00053 ostream& operator<<(ostream &os, const ReposError &err) throw ()
00054 /* Print a representation of "err" to "os". */
00055 {
00056     os << "Repository error: " << VestaSource::errorCodeString(err.code)
00057       << " (code = " << err.code << ")" << endl;
00058     os << "  Failing operation: " << err.op << "" << endl;
00059     if (!err.arg.Empty()) {
00060         os << "  Argument: '" << err.arg << "'" << endl;
00061     }
00062     return os;
00063 }

Generated on Mon May 8 00:48:58 2006 for Vesta by  doxygen 1.4.2