Panda3D
 All Classes Functions Variables Enumerations
error_utils.h
1 // Filename: error_utils.h
2 // Created by: mike (07Nov00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef ERROR_UTILS_H
16 #define ERROR_UTILS_H
17 
18 #include "pandabase.h"
19 #include "typedef.h"
20 
21 BEGIN_PUBLISH
22 
23 enum ErrorUtilCode {
24  EU_http_redirect = 7,
25  EU_eof = 6,
26  EU_network_no_data = 5,
27 
28  EU_write_ram = 4,
29  EU_write = 3,
30  EU_ok = 2,
31  EU_success = 1,
32 
33  // General errors
34  EU_error_abort = -1,
35  EU_error_file_empty = -2,
36  EU_error_file_invalid = -3,
37  EU_error_invalid_checksum = -4,
38 
39  // General network errors
40  EU_error_network_dead = -30,
41  EU_error_network_unreachable = -31,
42  EU_error_network_disconnected = -32,
43  EU_error_network_timeout = -33,
44  EU_error_network_no_data = -34,
45 
46  // Local network errors
47  EU_error_network_disconnected_locally = -40,
48  EU_error_network_buffer_overflow = -41,
49  EU_error_network_disk_quota_exceeded = -42,
50 
51  // Remote host network errors
52  EU_error_network_remote_host_disconnected = -50,
53  EU_error_network_remote_host_down = -51,
54  EU_error_network_remote_host_unreachable = -52,
55  EU_error_network_remote_host_not_found = -53,
56  EU_error_network_remote_host_no_response = -54,
57 
58  // General local errors
59  EU_error_write_out_of_files = -60,
60  EU_error_write_out_of_memory = -61,
61  EU_error_write_sharing_violation = -62,
62  EU_error_write_disk_full = -63,
63  EU_error_write_disk_not_found = -64,
64  EU_error_write_disk_sector_not_found = -65,
65  EU_error_write_disk_fault = -66,
66  EU_error_write_file_rename = -67,
67 
68  // HTTP errors
69  EU_error_http_server_timeout = -70,
70  EU_error_http_gateway_timeout = -71,
71  EU_error_http_service_unavailable = -72,
72  EU_error_http_proxy_authentication = -73,
73 
74  // Zlib errors
75  EU_error_zlib = -80,
76 };
77 
78 EXPCL_PANDAEXPRESS string error_to_text(ErrorUtilCode err);
79 EXPCL_PANDAEXPRESS int get_write_error();
80 
81 #ifdef HAVE_NET
82 EXPCL_PANDAEXPRESS string handle_socket_error();
83 EXPCL_PANDAEXPRESS int get_network_error();
84 #endif
85 
86 END_PUBLISH
87 
88 #endif
89