|
1 | 1 | #pragma once |
2 | 2 | #include "Exception.hpp" |
3 | 3 |
|
4 | | -namespace shared |
| 4 | +namespace shared::exception |
5 | 5 | { |
6 | | - namespace exception |
| 6 | + //-------------------------------------------------------------- |
| 7 | + /// \brief Exception for faulty download |
| 8 | + //-------------------------------------------------------------- |
| 9 | + class CDownloadFailed final : public CException |
7 | 10 | { |
8 | | - //-------------------------------------------------------------- |
9 | | - /// \brief Exception for faulty download |
10 | | - //-------------------------------------------------------------- |
11 | | - class CDownloadFailed : public CException |
| 11 | + public: |
| 12 | + explicit CDownloadFailed(const std::string& failToDownload) |
| 13 | + : CException(std::string("Fail to download ") |
| 14 | + + failToDownload) |
12 | 15 | { |
13 | | - public: |
| 16 | + } |
14 | 17 |
|
15 | | - //-------------------------------------------------------------- |
16 | | - /// \brief Constructor |
17 | | - //-------------------------------------------------------------- |
18 | | - explicit CDownloadFailed(const std::string& failToDownload) |
19 | | - : CException(std::string("Fail to download ") |
20 | | - + failToDownload) |
21 | | - { |
22 | | - } |
23 | 18 |
|
| 19 | + CDownloadFailed(const std::string& failToDownload, |
| 20 | + const std::string& reason) |
| 21 | + : CException(std::string("Fail to download ") |
| 22 | + + failToDownload + " " |
| 23 | + + reason) |
| 24 | + { |
| 25 | + } |
24 | 26 |
|
25 | | - //-------------------------------------------------------------- |
26 | | - /// \brief Constructor |
27 | | - //-------------------------------------------------------------- |
28 | | - CDownloadFailed(const std::string& failToDownload, |
29 | | - const std::string& reason) |
30 | | - : CException(std::string("Fail to download ") |
31 | | - + failToDownload + " " |
32 | | - + reason) |
33 | | - { |
34 | | - } |
35 | | - |
36 | | - //-------------------------------------------------------------- |
37 | | - /// \brief Constructor |
38 | | - //-------------------------------------------------------------- |
39 | | - CDownloadFailed(const std::string& failToDownload, |
40 | | - const boost::system::error_code& error) |
41 | | - : CException(std::string("Fail to download ") |
42 | | - + failToDownload |
43 | | - + " Message : " |
44 | | - + error.message() |
45 | | - + " \nCategory : " |
46 | | - + error.category().name() |
47 | | - + "\nValue : " |
48 | | - + std::to_string(error.value())) |
49 | | - { |
50 | | - } |
| 27 | + CDownloadFailed(const std::string& failToDownload, |
| 28 | + const boost::system::error_code& error) |
| 29 | + : CException(std::string("Fail to download ") |
| 30 | + + failToDownload |
| 31 | + + " Message : " |
| 32 | + + error.message() |
| 33 | + + " \nCategory : " |
| 34 | + + error.category().name() |
| 35 | + + "\nValue : " |
| 36 | + + std::to_string(error.value())) |
| 37 | + { |
| 38 | + } |
51 | 39 |
|
52 | | - //-------------------------------------------------------------- |
53 | | - /// \brief Destructor |
54 | | - //-------------------------------------------------------------- |
55 | | - virtual ~CDownloadFailed() throw() |
56 | | - { |
57 | | - } |
58 | | - }; |
59 | | - } |
60 | | -} // namespace shared::exception |
| 40 | + ~CDownloadFailed() throw() override |
| 41 | + { |
| 42 | + } |
| 43 | + }; |
| 44 | +} |
0 commit comments