File: exceptions.h

package info (click to toggle)
libappimage 1.0.4-5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,320 kB
  • sloc: cpp: 4,678; ansic: 1,325; sh: 169; python: 27; makefile: 19
file content (41 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

// system
#include <stdexcept>

namespace appimage {
    namespace core {
        /**
         * Generic Error that can be thrown by AppImage procedures.
         */
        class AppImageError : public std::runtime_error {
        public:
            explicit AppImageError(const std::string& what) : runtime_error(what) {}
        };

        /**
         * Throw in case of missing files, insufficient permissions and other file system related
         * errors.
         */
        class FileSystemError : public AppImageError {
        public:
            explicit FileSystemError(const std::string& what) : AppImageError(what) {}
        };

        /**
         * Throw in case of failure in a read or write operation.
         */
        class IOError : public AppImageError {
        public:
            explicit IOError(const std::string& what) : AppImageError(what) {}
        };

        /**
         * Throw in case of failure while iterating over the payload entries.
         */
        class PayloadIteratorError : public AppImageError {
        public:
            explicit PayloadIteratorError(const std::string& what) : AppImageError(what) {}
        };
    }
};