00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
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
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 }