00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MediaError_h
00022 #define MediaError_h
00023
00024 #include <iosfwd>
00025
00026 #include <y2pm/PMError.h>
00027
00029
00030
00035 class MediaError {
00036
00037 private:
00038
00039 friend class PMError;
00040
00041 static const std::string errclass;
00042
00043 static std::string errtext( const unsigned e );
00044
00045 public:
00046
00047 enum Error {
00048 E_ok = PMError::E_ok,
00049 E_error = PMError::C_MediaError,
00050
00051 E_system,
00052 E_not_a_directory,
00053 E_not_a_file,
00054 E_no_access,
00055 E_no_permission,
00056 E_no_space,
00057 E_bad_url,
00058 E_bad_media_type,
00059 E_bad_filename,
00060 E_already_attached,
00061 E_not_attached,
00062 E_bad_attachpoint,
00063 E_not_open,
00064 E_no_destination,
00065 E_no_source,
00066 E_invalid_device,
00067 E_invalid_filesystem,
00068 E_no_host_specified,
00069
00070 E_file_not_found,
00071 E_login_failed,
00072 E_connection_failed,
00073 E_proxyauth_failed,
00074
00075 E_mount_failed,
00076 E_umount_failed,
00077 E_already_mounted,
00078 E_busy,
00079
00080 E_attachpoint_fixed,
00081 E_not_supported_by_media,
00082
00083 E_curl_setopt_failed,
00084 E_write_error,
00085 E_user_abort
00086 };
00087
00088 friend std::ostream & operator<<( std::ostream & str, const Error & obj ) {
00089 return str << PMError( obj );
00090 }
00091 };
00092
00094
00095 #endif // MediaError_h
00096