File: fgexc.cc

package info (click to toggle)
ftpgrab 0.1.1-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 360 kB
  • ctags: 328
  • sloc: cpp: 2,749; makefile: 59
file content (67 lines) | stat: -rw-r--r-- 1,688 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// fgexc.cc

#include "fgexc.h"

// String table of exception messages
const char* const exceptionTexts[] =
  {"Hostname lookup failed",
   "Hostname lookup failed",
   "Couldn't allocate resources to connect",
   "Connection refused at remote site",
   "No response from remote site",
   "Failed to connect to remote site",
   "FTP response too large!",
   "FTP response malformed!",
   "FTP response code unexpected!",
   "FTP server refuses connection",
   "FTP server is full",
   "Remote directory not found",
   "Remote file not found",
   "Local directory not found",
   "Local file not found",
   "Permission denied (local)",
   "Timeout downloading file",
   "Cannot open config file",
   "Missing `:' in config file",
   "Duplicate token in config file",
   "Config file ended in middle of rule",
   "Failed to create local file",
   "Detected concurrent download of same file",
   "Failed to unlink local file",
   "I/O error writing local file",
   "Could not open/create log file",
   "Unexpected end of string parsing filename rule",
   "Unexpected character parsing filename rule",
   "Unrecognized component token",
   "Invalid regular expression",
   "Error reading from network",
   "Unexpected file EOF (remote died?)"
};

FGException::FGException(EFGExceptions reason, const FGString& details)
: mWhat(reason), mDetails(details)
{
}

FGException::FGException(EFGExceptions reason)
: mWhat(reason)
{
}

FGException::EFGExceptions
FGException::GetReason(void) const
{
  return mWhat;
}

FGString
FGException::GetFullDetails(void) const
{
  FGString ret(exceptionTexts[(int)mWhat]);
  if (!mDetails.IsEmpty()) {
    ret += ": ";
    ret += mDetails;
  }

  return ret;
}