1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/MediaException.cc
16 #include "zypp/media/MediaException.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
24 /////////////////////////////////////////////////////////////////
26 std::ostream & MediaMountException::dumpOn( std::ostream & str ) const
28 return str << "Failed to mount " << _source << " on " << _target
29 << " : " << _error << endl;
32 std::ostream & MediaUnmountException::dumpOn( std::ostream & str ) const
34 return str << "Failed to unmount " << _path
35 << " : " << _error << endl;
38 std::ostream & MediaBadFilenameException::dumpOn( std::ostream & str ) const
40 return str << "Bad file name " << _filename << endl;
43 std::ostream & MediaNotOpenException::dumpOn( std::ostream & str ) const
45 return str << "Media not opened while performing action " << _action << endl;
48 std::ostream & MediaFileNotFoundException::dumpOn( std::ostream & str) const
50 return str << "File " << _filename
51 << " not found on media: " << _url << endl;
54 std::ostream & MediaWriteException::dumpOn( std::ostream & str) const
56 return str << "Cannot write file " << _filename << endl;
59 std::ostream & MediaNotAttachedException::dumpOn( std::ostream & str) const
61 return str << "Media not attached: " << _url << endl;
64 std::ostream & MediaBadAttachPointException::dumpOn( std::ostream & str) const
66 return str << "Bad media attach point: " << _url << endl;
69 std::ostream & MediaCurlInitException::dumpOn( std::ostream & str) const
71 return str << "Curl init failed for: " << _url << endl;
74 std::ostream & MediaSystemException::dumpOn( std::ostream & str) const
76 return str << "System exception: " << _message
77 << " on media: " << _url << endl;
80 std::ostream & MediaNotAFileException::dumpOn( std::ostream & str) const
82 return str << "Path " << _path
83 << " on media: " << _url
84 << " is not a file." << endl;
87 std::ostream & MediaNotADirException::dumpOn( std::ostream & str) const
89 return str << "Path " << _path
90 << " on media: " << _url
91 << " is not a directory." << endl;
94 std::ostream & MediaBadUrlException::dumpOn( std::ostream & str) const
96 return str << "Malformed URL: " << _url << endl;
99 std::ostream & MediaBadUrlEmptyHostException::dumpOn( std::ostream & str) const
101 return str << "Empty host name in URL: " << _url << endl;
104 std::ostream & MediaBadUrlEmptyFilesystemException::dumpOn( std::ostream & str) const
106 return str << "Empty filesystem in URL: " << _url << endl;
109 std::ostream & MediaBadUrlEmptyDestinationException::dumpOn( std::ostream & str) const
111 return str << "Empty destination in URL: " << _url << endl;
114 std::ostream & MediaUnsupportedUrlSchemeException::dumpOn( std::ostream & str) const
116 return str << "Unsupported URL scheme in URL: " << _url << endl;
119 std::ostream & MediaNotSupportedException::dumpOn( std::ostream & str) const
121 return str << "Operation not supported by media: " << _url << endl;
124 std::ostream & MediaCurlException::dumpOn( std::ostream & str) const
126 return str << "Curl error for: " << _url
127 << ": Error code: " << _err
128 << " Error message: " << _msg << endl;
131 std::ostream & MediaCurlSetOptException::dumpOn( std::ostream & str) const
133 return str << "Error occurred while setting CURL options for " << _url
134 << ": " << _msg << endl;
137 std::ostream & MediaNotDesiredException::dumpOn( std::ostream & str ) const
139 return str << "Media source " << _url << " does not contain the desired media" << endl;
142 std::ostream & MediaIsSharedException::dumpOn( std::ostream & str ) const
144 return str << "Media " << _name << " is in use by another instance" << endl;
147 /////////////////////////////////////////////////////////////////
150 ///////////////////////////////////////////////////////////////////